]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fixes countdown centerprints not getting killed
authorz411 <z411@omaera.org>
Fri, 1 Apr 2022 22:20:52 +0000 (19:20 -0300)
committerz411 <z411@omaera.org>
Fri, 1 Apr 2022 22:20:52 +0000 (19:20 -0300)
qcsrc/client/hud/panel/centerprint.qc

index 5a18bf388a4422cc60439a6c1642330b3849ca31..76118afba2117016af678c8e670416029e801659 100644 (file)
@@ -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;
                }