X-Git-Url: https://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_player.pas;h=98535cc9ef2f36220f98ba05b4cbb0a401598cac;hb=db4e988645273fe1c11611d84e03f0199cd181f7;hp=06ae6e50340317cda52f96b1b34228d50c48f18c;hpb=2a25db0f5f685dcc316bbaa822bf7d455a0bdb85;p=d2df-sdl.git diff --git a/src/game/g_player.pas b/src/game/g_player.pas index 06ae6e5..98535cc 100644 --- a/src/game/g_player.pas +++ b/src/game/g_player.pas @@ -471,7 +471,9 @@ type procedure positionChanged (); inline; //WARNING! call this after entity position was changed, or coldet will not work right! - property Obj: TObj read FObj; + function ObjPtr (): PObj; inline; + + property Obj: TObj read FObj; // copies object property State: Byte read FState; property Mess: Boolean read FMess; end; @@ -3978,15 +3980,17 @@ begin if not (R_BERSERK in FRulez) then begin Include(FRulez, R_BERSERK); - if FBFGFireCounter = -1 then + if gBerserkAutoswitch and (gDebugMode or gCheats) and (FBFGFireCounter = -1) then begin FCurrWeap := WEAPON_KASTET; resetWeaponQueue(); FModel.SetWeapon(WEAPON_KASTET); end; if gFlash <> 0 then + begin Inc(FPain, 100); if gFlash = 2 then Inc(FPickup, 5); + end; FBerserk := gTime+30000; Result := True; remove := True; @@ -6159,6 +6163,8 @@ begin inherited; end; +function TCorpse.ObjPtr (): PObj; inline; begin result := @FObj; end; + procedure TCorpse.positionChanged (); inline; begin end; procedure TCorpse.moveBy (dx, dy: Integer); inline; @@ -7608,4 +7614,7 @@ begin FDifficult := TDifficult(p^); end; + +begin + conRegVar('cheat_berserk_autoswitch', @gBerserkAutoswitch, 'autoswitch to fist when berserk pack taken', '', true, true); end.