]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/scores.qc
Refactored leads announcer
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / scores.qc
index 8906547c496cbdf43b6fdb10f1778fc9f8fbd97b..2874a84106de1af9068a13cb593da189bde3b154 100644 (file)
@@ -412,6 +412,24 @@ float PlayerScore_Compare(entity t1, entity t2, bool strict)
        return result.x;
 }
 
+bool Score_NewLeader()
+{
+       if(teamplay) {
+               if (WinningConditionHelper_winnerteam != WinningConditionHelper_winnerteam_last && (WinningConditionHelper_secondteam || WinningConditionHelper_equality))
+               {
+                       WinningConditionHelper_winnerteam_last = WinningConditionHelper_winnerteam;
+                       return true;
+               }
+       } else {
+               if (WinningConditionHelper_winner != WinningConditionHelper_winner_last && (WinningConditionHelper_second || WinningConditionHelper_equality))
+               {
+                       WinningConditionHelper_winner_last = WinningConditionHelper_winner;
+                       return true;
+               }
+       }
+       return false;
+}
+
 void WinningConditionHelper(entity this)
 {
        float c;