From: z411 Date: Fri, 1 Apr 2022 22:20:52 +0000 (-0300) Subject: Fixes countdown centerprints not getting killed X-Git-Tag: xonotic-v0.8.5~94^2~7 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=efbaaa09d12bba84d997ed801a30e1b165d9fc8c;p=xonotic%2Fxonotic-data.pk3dir.git Fixes countdown centerprints not getting killed --- 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; }