From: Ketmar Dark Date: Thu, 7 Sep 2017 20:01:43 +0000 (+0300) Subject: berserk autoswitch is cheat now X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=51fce0c702def28ce29efd0299c63536b42ebaeb;p=d2df-sdl.git berserk autoswitch is cheat now --- diff --git a/src/game/g_game.pas b/src/game/g_game.pas index 6a26b04..1d95bda 100644 --- a/src/game/g_game.pas +++ b/src/game/g_game.pas @@ -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); diff --git a/src/game/g_player.pas b/src/game/g_player.pas index 98535cc..fb96ef9 100644 --- a/src/game/g_player.pas +++ b/src/game/g_player.pas @@ -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();