]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Removed redundant timeout STAT
authorz411 <z411@omaera.org>
Wed, 28 Apr 2021 19:35:57 +0000 (15:35 -0400)
committerz411 <z411@omaera.org>
Wed, 28 Apr 2021 19:35:57 +0000 (15:35 -0400)
qcsrc/client/announcer.qc
qcsrc/client/hud/panel/timer.qc
qcsrc/common/stats.qh
qcsrc/server/command/common.qc

index 301185a922586a0ed69081ee77712065d0aa1d9e..81b04b89e724a853b7eeb9fbb819c8cd2a32570c 100644 (file)
@@ -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;
index 8679742b49a4f46e4482d163fd9fc802da9fea28..34c9d3cffa8a52f46e3f26c188e3e233c31df25d 100644 (file)
@@ -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
index a059789b90566d38e8b643d2d13bbf5e2ea0641f..576279112dc4e6b115a8ffdb73260ddacb413d46 100644 (file)
@@ -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)
index b3af9adca304b625a56ec2b55441b88cc33c914a..65d5a123e77d7dc3ce2eebca74be97556a0f5505 100644 (file)
@@ -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), {