DEADSOFTWARE

only save stats when there's multiple players present
authorfgsfds <pvt.fgsfds@gmail.com>
Sat, 8 Feb 2020 23:29:45 +0000 (02:29 +0300)
committerfgsfds <pvt.fgsfds@gmail.com>
Sat, 8 Feb 2020 23:29:45 +0000 (02:29 +0300)
src/game/g_game.pas

index d03d02a47f13494d22353492dc80ba35676346ce..504171d4e52390b2bce42e5fbd34e78d473a3b40 100644 (file)
@@ -1064,14 +1064,15 @@ begin
 
           SortGameStat(CustomStat.PlayerStat);
 
-          if gSaveStats or gScreenshotStats then
+          if (gSaveStats or gScreenshotStats) and (Length(gPlayers) > 1) then
           begin
             t := Now;
             if g_Game_IsNet then StatFilename := NetServerName else StatFilename := 'local';
             StatDate := FormatDateTime('yymmdd_hhnnss', t);
             StatFilename := StatFilename + '_' + CustomStat.Map + '_' + g_Game_ModeToText(CustomStat.GameMode);
             StatFilename := sanitizeFilename(StatFilename) + '_' + StatDate;
-            if gSaveStats then SaveGameStat(CustomStat, FormatDateTime('yyyy"/"mm"/"dd', t));
+            if gSaveStats then
+              SaveGameStat(CustomStat, FormatDateTime('yyyy"/"mm"/"dd', t));
           end;
 
           StatShotDone := False;