From 0693f96bbc32e033304c196cc9c3c92a7a566621 Mon Sep 17 00:00:00 2001 From: terencehill Date: Sat, 26 Mar 2022 23:28:31 +0100 Subject: [PATCH] Forbid setting sudden death overtime when the game ends --- qcsrc/server/world.qc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) 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(); } -- 2.39.5