From 54422dc7dd83d5c2b97a0e2317b9729b01f0679a Mon Sep 17 00:00:00 2001 From: terencehill Date: Sat, 30 Jan 2016 11:11:25 +0100 Subject: [PATCH] Kill countdown (centerprint) to game start if the game ended in the meantime --- qcsrc/client/announcer.qc | 13 +++++++++++++ qcsrc/client/hud/panel/centerprint.qc | 5 +++++ qcsrc/client/main.qh | 1 + 3 files changed, 19 insertions(+) diff --git a/qcsrc/client/announcer.qc b/qcsrc/client/announcer.qc index 707e3c8a76..680060cdbe 100644 --- a/qcsrc/client/announcer.qc +++ b/qcsrc/client/announcer.qc @@ -77,6 +77,19 @@ void Announcer_Gamestart() float roundstarttime = STAT(ROUNDSTARTTIME); if(roundstarttime > startTime) startTime = roundstarttime; + if(intermission) + { + if(announcer_countdown) + { + centerprint_kill(CPID_ROUND); + if(announcer_countdown) + { + remove(announcer_countdown); + announcer_countdown = NULL; + } + } + return; + } if(previous_game_starttime != startTime) { diff --git a/qcsrc/client/hud/panel/centerprint.qc b/qcsrc/client/hud/panel/centerprint.qc index 3169d925d2..0c64aa00a9 100644 --- a/qcsrc/client/hud/panel/centerprint.qc +++ b/qcsrc/client/hud/panel/centerprint.qc @@ -87,6 +87,11 @@ void centerprint_generic(int new_id, string strMessage, float duration, int coun centerprint_countdown_num[j] = countdown_num; } +void centerprint_kill(float id) +{ + centerprint_generic(id, "", 0, 0); +} + void centerprint_hud(string strMessage) { centerprint_generic(0, strMessage, autocvar_hud_panel_centerprint_time, 0); diff --git a/qcsrc/client/main.qh b/qcsrc/client/main.qh index 31db3f86e7..bed4daa268 100644 --- a/qcsrc/client/main.qh +++ b/qcsrc/client/main.qh @@ -125,6 +125,7 @@ float camera_roll; vector camera_direction; void centerprint_hud(string strMessage); +void centerprint_kill(float id); void centerprint_generic(float new_id, string strMessage, float duration, float countdown_num); const float ALPHA_MIN_VISIBLE = 0.003; -- 2.39.2