From: z411 Date: Wed, 28 Apr 2021 19:35:57 +0000 (-0400) Subject: Removed redundant timeout STAT X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=ccfc57fd8a33a61ccf2376bfc86f26735f55b705;p=xonotic%2Fxonotic-data.pk3dir.git Removed redundant timeout STAT --- diff --git a/qcsrc/client/announcer.qc b/qcsrc/client/announcer.qc index 301185a92..81b04b89e 100644 --- a/qcsrc/client/announcer.qc +++ b/qcsrc/client/announcer.qc @@ -25,7 +25,7 @@ void Announcer_Countdown(entity this) { float starttime = STAT(GAMESTARTTIME); float roundstarttime = STAT(ROUNDSTARTTIME); - float game_timeout = STAT(GAME_TIMEOUT); + bool game_timeout = (STAT(TIMEOUT_LAST) > 0); bool rounds; float countdown; diff --git a/qcsrc/client/hud/panel/timer.qc b/qcsrc/client/hud/panel/timer.qc index 8679742b4..34c9d3cff 100644 --- a/qcsrc/client/hud/panel/timer.qc +++ b/qcsrc/client/hud/panel/timer.qc @@ -37,12 +37,10 @@ void HUD_Timer() } string timer_sub = ""; - bool game_timeout; float timelimit, timeleft, minutesLeft, overtimes, timeout_last; timelimit = STAT(TIMELIMIT); overtimes = STAT(OVERTIMESADDED); - game_timeout = STAT(GAME_TIMEOUT); timeout_last = STAT(TIMEOUT_LAST); timeleft = max(0, timelimit * 60 + STAT(GAMESTARTTIME) - time); @@ -73,7 +71,7 @@ void HUD_Timer() timer = max(0, floor(intermission_time - STAT(GAMESTARTTIME))); timer_sub = "Intermission"; //} else if (autocvar_hud_panel_timer_increment || (!warmup_stage && timelimit == 0) || (warmup_stage && warmup_timeleft <= 0)) { - } else if (game_timeout) { + } else if (timeout_last) { if(autocvar_hud_panel_timer_increment) timer = max(0, floor(timeout_last - STAT(GAMESTARTTIME))); else diff --git a/qcsrc/common/stats.qh b/qcsrc/common/stats.qh index a059789b9..576279112 100644 --- a/qcsrc/common/stats.qh +++ b/qcsrc/common/stats.qh @@ -91,7 +91,6 @@ int autocvar_leadlimit; REGISTER_STAT(WEAPONRATEFACTOR, float, W_WeaponRateFactor(this)) REGISTER_STAT(GAME_STOPPED, int, game_stopped) -REGISTER_STAT(GAME_TIMEOUT, bool, game_timeout) REGISTER_STAT(TIMEOUT_LAST, float, timeout_last) REGISTER_STAT(GAMESTARTTIME, float, game_starttime) diff --git a/qcsrc/server/command/common.qc b/qcsrc/server/command/common.qc index b3af9adca..65d5a123e 100644 --- a/qcsrc/server/command/common.qc +++ b/qcsrc/server/command/common.qc @@ -241,6 +241,7 @@ void timeout_handler_think(entity this) round_handler.round_endtime += total_time; LOG_INFOF("Timeout lasted %d secs", total_time); + timeout_last = 0; // unlock the view for players so they can move around again FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it), {