From: terencehill Date: Sat, 26 Mar 2022 22:28:31 +0000 (+0100) Subject: Forbid setting sudden death overtime when the game ends X-Git-Tag: xonotic-v0.8.5~133 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=0693f96bbc32e033304c196cc9c3c92a7a566621;p=xonotic%2Fxonotic-data.pk3dir.git Forbid setting sudden death overtime when the game ends --- diff --git a/qcsrc/server/world.qc b/qcsrc/server/world.qc index 7fce21e6e..5801fae88 100644 --- a/qcsrc/server/world.qc +++ b/qcsrc/server/world.qc @@ -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(); }