DEADSOFTWARE

player: fix frag decrement on suicide
authorDeaDDooMER <deaddoomer@deadsoftware.ru>
Fri, 25 Mar 2022 21:03:23 +0000 (00:03 +0300)
committerDeaDDooMER <deaddoomer@deadsoftware.ru>
Fri, 25 Mar 2022 21:03:23 +0000 (00:03 +0300)
src/game/g_player.pas

index 9aa72a832c3c6d2cf52adfdb1ac70adcee3565cf..b04cdc2cf1a42740ce70fbbacf5143bbb8dd0b54 100644 (file)
@@ -3381,11 +3381,15 @@ begin
 
   if SpawnerUID = FUID then
     begin // Ñàìîóáèëñÿ
-      if Srv and (gGameSettings.GameMode = GM_TDM) then
-      Dec(gTeamStat[FTeam].Goals);
+      if Srv then
       begin
-        Dec(FFrags);
-        FLastFrag := 0;
+        if gGameSettings.GameMode = GM_TDM then
+          Dec(gTeamStat[FTeam].Goals);
+        if DoFrags or (gGameSettings.GameMode = GM_TDM) then
+        begin
+          Dec(FFrags);
+          FLastFrag := 0;
+        end;
       end;
       g_Console_Add(Format(_lc[I_PLAYER_KILL_SELF], [FName]), True);
     end