]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Use separate round end indicator
authorz411 <z411@omaera.org>
Sat, 9 Apr 2022 01:10:22 +0000 (21:10 -0400)
committerz411 <z411@omaera.org>
Sat, 9 Apr 2022 01:10:22 +0000 (21:10 -0400)
qcsrc/client/hud/panel/timer.qc
qcsrc/common/stats.qh
qcsrc/server/round_handler.qc

index ccbfabc209838ee3ac62d814b3d20903706184cb..193a3ca9054e258b36a44414146fbd634309b4f1 100644 (file)
@@ -140,11 +140,12 @@ void HUD_Timer()
                        subtimer = "--:--";
                        subtimer_color = '1 0 0';
                } else {
-                       float round_curtime, round_timelimit, round_timeleft;
+                       float round_curtime, round_endtime, round_timelimit, round_timeleft;
 
                        // Use real or frozen time and get the time limit
-                       round_curtime = (game_stopped_time ? game_stopped_time : time);
+                       round_endtime = STAT(ROUNDENDTIME);
                        round_timelimit = STAT(ROUND_TIMELIMIT);
+                       round_curtime = (round_endtime ? round_endtime : time);
 
                        // Calculate time left
                        round_timeleft = HUD_Timer_TimeLeft(round_curtime, STAT(ROUNDSTARTTIME), round_timelimit);
index 4ed9b95f67c1ceb71df3122519c4a8563e9abdf4..293714014ad61cb3ca8de9592c56319b504596d7 100644 (file)
@@ -78,6 +78,7 @@ float W_WeaponRateFactor(entity this);
 float game_stopped;
 float game_starttime; //point in time when the countdown to game start is over
 float round_starttime; //point in time when the countdown to round start is over
+float round_delaytime;
 float overtime_starttime; // z411 point in time where first overtime started
 
 float timeout_last;
@@ -125,6 +126,7 @@ REGISTER_STAT(VEHICLESTAT_W2MODE, int)
 REGISTER_STAT(NADE_TIMER, float)
 REGISTER_STAT(RESPAWN_TIME, float)
 REGISTER_STAT(ROUNDSTARTTIME, float, round_starttime)
+REGISTER_STAT(ROUNDENDTIME, float, round_delaytime)
 REGISTER_STAT(OVERTIMES, int, overtimes)
 REGISTER_STAT(TIMEOUT_STATUS, int, timeout_status)
 REGISTER_STAT(NADE_BONUS, float)
index 44757cfd152b4c0bc6b30c53cd455b8d0b871de2..1e896344bda6667aca3771e84153e76a6cf564f3 100644 (file)
@@ -65,6 +65,7 @@ void round_handler_Think(entity this)
                if (this.canRoundEnd())
                {
                        // schedule a new round
+                       round_delaytime = time;
                        this.wait = true;
                        this.nextthink = time + this.delay;
                }
@@ -135,6 +136,7 @@ void round_handler_Reset(float next_think)
        {
                if (next_think <= game_starttime) rounds_played = 0;
                round_starttime = next_think + this.count;
+               round_delaytime = 0;
        }
 }