From: z411 Date: Sat, 9 Apr 2022 01:10:22 +0000 (-0400) Subject: Use separate round end indicator X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8cf3ccb376f6426afa4c60e2da55f391958ff7f5;p=xonotic%2Fxonotic-data.pk3dir.git Use separate round end indicator --- diff --git a/qcsrc/client/hud/panel/timer.qc b/qcsrc/client/hud/panel/timer.qc index ccbfabc20..193a3ca90 100644 --- a/qcsrc/client/hud/panel/timer.qc +++ b/qcsrc/client/hud/panel/timer.qc @@ -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); diff --git a/qcsrc/common/stats.qh b/qcsrc/common/stats.qh index 4ed9b95f6..293714014 100644 --- a/qcsrc/common/stats.qh +++ b/qcsrc/common/stats.qh @@ -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) diff --git a/qcsrc/server/round_handler.qc b/qcsrc/server/round_handler.qc index 44757cfd1..1e896344b 100644 --- a/qcsrc/server/round_handler.qc +++ b/qcsrc/server/round_handler.qc @@ -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; } }