]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Announce 1 frag remaining when suddendeath mode starts
authorterencehill <piuntn@gmail.com>
Wed, 27 May 2020 12:54:50 +0000 (14:54 +0200)
committerterencehill <piuntn@gmail.com>
Wed, 27 May 2020 12:54:50 +0000 (14:54 +0200)
qcsrc/server/g_world.qc

index 8d1b58629cd7374f47eb304db066e8071c36d2d0..d9ca813aa372a3dc331704ef168254d0e68475b7 100644 (file)
@@ -1743,16 +1743,25 @@ float WinningCondition_Scores(float limit, float leadlimit)
 
        if(MUTATOR_CALLHOOK(Scores_CountFragsRemaining))
        {
-               float fragsleft = FLOAT_MAX, leadingfragsleft = FLOAT_MAX;
-               if (limit)
-                       fragsleft = limit - WinningConditionHelper_topscore;
-               if (leadlimit)
-                       leadingfragsleft = WinningConditionHelper_secondscore + leadlimit - WinningConditionHelper_topscore;
-
-               if (limit && leadlimit && autocvar_leadlimit_and_fraglimit)
-                       fragsleft = max(fragsleft, leadingfragsleft);
+               float fragsleft;
+               if (checkrules_suddendeathend && time >= checkrules_suddendeathend)
+               {
+                       fragsleft = 1;
+               }
                else
-                       fragsleft = min(fragsleft, leadingfragsleft);
+               {
+                       fragsleft = FLOAT_MAX;
+                       float leadingfragsleft = FLOAT_MAX;
+                       if (limit)
+                               fragsleft = limit - WinningConditionHelper_topscore;
+                       if (leadlimit)
+                               leadingfragsleft = WinningConditionHelper_secondscore + leadlimit - WinningConditionHelper_topscore;
+
+                       if (limit && leadlimit && autocvar_leadlimit_and_fraglimit)
+                               fragsleft = max(fragsleft, leadingfragsleft);
+                       else
+                               fragsleft = min(fragsleft, leadingfragsleft);
+               }
 
                if (fragsleft_last != fragsleft) // do not announce same remaining frags multiple times
                {