]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Forbid setting sudden death overtime when the game ends
authorterencehill <piuntn@gmail.com>
Sat, 26 Mar 2022 22:28:31 +0000 (23:28 +0100)
committerterencehill <piuntn@gmail.com>
Sat, 26 Mar 2022 22:31:32 +0000 (23:31 +0100)
qcsrc/server/world.qc

index 7fce21e6ee81f69fe4a35112daaec00739e22ccc..5801fae88a3eb2fbd06d091e81bed09b779c38d4 100644 (file)
@@ -1334,7 +1334,7 @@ void NextLevel()
 }
 
 
-float InitiateSuddenDeath()
+int InitiateSuddenDeath()
 {
        // Check first whether normal overtimes could be added before initiating suddendeath mode
        // - for this timelimit_overtime needs to be >0 of course
@@ -1630,8 +1630,8 @@ void CheckRules_World()
        if(timelimit > 0)
                timelimit += game_starttime;
 
-       float wantovertime;
-       wantovertime = 0;
+       int overtimes_prev = overtimes;
+       int wantovertime = 0;
 
        if(checkrules_suddendeathend)
        {
@@ -1717,6 +1717,12 @@ void CheckRules_World()
 
        if(checkrules_status == WINNING_YES)
        {
+               if (overtimes == -1 && overtimes != overtimes_prev)
+               {
+                       // if suddendeathend overtime has just begun, revert it
+                       checkrules_suddendeathend = 0;
+                       overtimes = overtimes_prev;
+               }
                //print("WINNING\n");
                NextLevel();
        }