DEADSOFTWARE

berserk autoswitch is cheat now
authorKetmar Dark <ketmar@ketmar.no-ip.org>
Thu, 7 Sep 2017 20:01:43 +0000 (23:01 +0300)
committerKetmar Dark <ketmar@ketmar.no-ip.org>
Thu, 7 Sep 2017 20:02:28 +0000 (23:02 +0300)
src/game/g_game.pas
src/game/g_player.pas

index 6a26b044dc0aed035326e0e24f0fd61009f8b426..1d95bda6e40339c5e2a11b94d0dcddd04e1ae93c 100644 (file)
@@ -2750,17 +2750,17 @@ begin
   (*
    * light rendering: (INVALID!)
    *   glStencilFunc(GL_EQUAL, 0, $ff);
-   *   clear depth buffer
-   *   renderAmbientQuad()
    *   for each light:
+   *     glClear(GL_STENCIL_BUFFER_BIT);
    *     glStencilOp(GL_KEEP, GL_KEEP, GL_INCR);
    *     draw shadow volume into stencil buffer
    *     glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); // modify color buffer
    *     glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP); // don't modify stencil buffer
    *     turn off blending
-   *     draw quad with light alpha
+   *     draw color-less quad with light alpha (WARNING! don't touch color!)
    *     glEnable(GL_BLEND);
-   *     gl.glBlendFunc(GL_DST_ALPHA, GL_ONE);
+   *     glBlendFunc(GL_DST_ALPHA, GL_ONE);
+   *     draw all geometry up to and including walls (with alpha-testing, probably) -- this does lighting
    *)
 
   wassc := (glIsEnabled(GL_SCISSOR_TEST) <> 0);
index 98535cc9ef2f36220f98ba05b4cbb0a401598cac..fb96ef9e3d56654ab0074c557ebc05f8c62aa23c 100644 (file)
@@ -3638,6 +3638,16 @@ begin
 end;
 
 function TPlayer.PickItem(ItemType: Byte; arespawn: Boolean; var remove: Boolean): Boolean;
+
+  function allowBerserkSwitching (): Boolean;
+  begin
+    if (FBFGFireCounter <> -1) then begin result := false; exit; end;
+    result := true;
+    if gBerserkAutoswitch then exit;
+    if not (gDebugMode or gCheats) then exit;
+    result := false;
+  end;
+
 var
   a: Boolean;
 begin
@@ -3980,7 +3990,7 @@ begin
         if not (R_BERSERK in FRulez) then
         begin
           Include(FRulez, R_BERSERK);
-          if gBerserkAutoswitch and (gDebugMode or gCheats) and (FBFGFireCounter = -1) then
+          if allowBerserkSwitching then
           begin
             FCurrWeap := WEAPON_KASTET;
             resetWeaponQueue();