From efbaaa09d12bba84d997ed801a30e1b165d9fc8c Mon Sep 17 00:00:00 2001 From: z411 Date: Fri, 1 Apr 2022 19:20:52 -0300 Subject: [PATCH] Fixes countdown centerprints not getting killed --- qcsrc/client/hud/panel/centerprint.qc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/qcsrc/client/hud/panel/centerprint.qc b/qcsrc/client/hud/panel/centerprint.qc index 5a18bf388..76118afba 100644 --- a/qcsrc/client/hud/panel/centerprint.qc +++ b/qcsrc/client/hud/panel/centerprint.qc @@ -86,9 +86,10 @@ void centerprint_Add(int new_id, string strMessage, float duration, int countdow j = 0; if (new_id && new_id == centerprint_msgID[j]) { - if (strMessage == "" && centerprint_messages[j] != "" && centerprint_countdown_num[j] == 0) + if (strMessage == "" && centerprint_messages[j] != "") { // fade out the current msg (duration and countdown_num are ignored) + centerprint_start_time[j] = 0; centerprint_time[j] = min(5, autocvar_hud_panel_centerprint_fade_out); centerprint_expire_time[j] = -1; // don't use the variable time here! return; @@ -303,7 +304,7 @@ void HUD_CenterPrint() } if (centerprint_expire_time[j] <= time) { - if (centerprint_countdown_num[j] && centerprint_time[j] > 0) + if (centerprint_countdown_num[j] && centerprint_time[j] > 0 && centerprint_start_time[j]) { centerprint_countdown_num[j] = centerprint_countdown_num[j] - 1; if (centerprint_countdown_num[j] == 0) @@ -321,7 +322,7 @@ void HUD_CenterPrint() float fade_in_time = autocvar_hud_panel_centerprint_fade_in; float fade_out_time = autocvar_hud_panel_centerprint_fade_out; - if (centerprint_countdown_num[j]) { + if (centerprint_countdown_num[j] && centerprint_start_time[j]) { fade_in_time = 0; fade_out_time = 0; } -- 2.39.2