]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Added logging to preventStalemate z411/ca-prevent-stalemates
authorz411 <z411@omaera.org>
Thu, 29 Sep 2022 01:55:58 +0000 (22:55 -0300)
committerz411 <z411@omaera.org>
Thu, 29 Sep 2022 01:55:58 +0000 (22:55 -0300)
qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qc

index 00540060f87262313ae7bcfef63bf1371b7ef08b..91fbc3caab830d3cbf4055803af0fe0f977aff98 100644 (file)
@@ -47,6 +47,7 @@ void nades_Clear(entity player);
 
 int CA_PreventStalemate()
 {
+       //LOG_INFO("PreventStalemate running");
        int winnerTeam = 0;
        int secondTeam = 0;
 
@@ -67,9 +68,15 @@ int CA_PreventStalemate()
        }
 
        if(Team_GetNumberOfAlivePlayers(Team_GetTeam(winnerTeam)) != Team_GetNumberOfAlivePlayers(Team_GetTeam(secondTeam)))
+       {
+               LOG_INFOF("Stalemate broken by alive players. Best team: %s%s (%d)^7 - Trailing team: %s%s (%d)",
+                       Team_ColorCode(winnerTeam), Team_ColorName(winnerTeam), Team_GetNumberOfAlivePlayers(Team_GetTeam(winnerTeam)),
+                       Team_ColorCode(secondTeam), Team_ColorName(secondTeam), Team_GetNumberOfAlivePlayers(Team_GetTeam(secondTeam)));
                return winnerTeam;
+       }
 
        // Equality. Let's check which team has more health now
+       //LOG_INFO("Equality. Checking health now.");
        winnerTeam = 0;
        secondTeam = 0;
        int winnerTeamHealth = 0;
@@ -108,7 +115,12 @@ int CA_PreventStalemate()
        }
 
        if(winnerTeamHealth != secondTeamHealth)
+       {
+               LOG_INFOF("Stalemate broken by team health. Best team: %s%s (%d)^7 - Trailing team: %s%s (%d)",
+                       Team_ColorCode(winnerTeam), Team_ColorName(winnerTeam), winnerTeamHealth,
+                       Team_ColorCode(secondTeam), Team_ColorName(secondTeam), secondTeamHealth);
                return winnerTeam;
+       }
        else
                return -2; // Equality. Can't avoid the stalemate.
 }