]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/announcer.qc
Silence a warning when countdown number is higher than the available announcements
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / announcer.qc
index 707e3c8a7657e5b6c8d3495cefe5875ff1111e83..016c87f326d298db2debceaeeb6688f8bc9670d0 100644 (file)
@@ -2,7 +2,7 @@
 
 #include "mutators/events.qh"
 
-#include <common/notifications.qh>
+#include <common/notifications/all.qh>
 #include <common/stats.qh>
 
 bool announcer_1min;
@@ -51,12 +51,16 @@ void Announcer_Countdown()
                if(roundstarttime == starttime)
                {
                        Local_Notification(MSG_CENTER, CENTER_COUNTDOWN_ROUNDSTART, countdown_rounded);
-                       Local_Notification(MSG_ANNCE, Announcer_PickNumber(CNT_ROUNDSTART, countdown_rounded));
+                       Notification annce_num = Announcer_PickNumber(CNT_ROUNDSTART, countdown_rounded);
+                       if(annce_num != NULL)
+                               Local_Notification(MSG_ANNCE, annce_num);
                }
                else
                {
                        Local_Notification(MSG_CENTER, CENTER_COUNTDOWN_GAMESTART, countdown_rounded);
-                       Local_Notification(MSG_ANNCE, Announcer_PickNumber(CNT_GAMESTART, countdown_rounded));
+                       Notification annce_num = Announcer_PickNumber(CNT_GAMESTART, countdown_rounded);
+                       if(annce_num != NULL)           
+                               Local_Notification(MSG_ANNCE, Announcer_PickNumber(CNT_GAMESTART, countdown_rounded));
                }
 
                this.nextthink = (starttime - (countdown - 1));
@@ -77,6 +81,19 @@ void Announcer_Gamestart()
        float roundstarttime = STAT(ROUNDSTARTTIME);
        if(roundstarttime > startTime)
                startTime = roundstarttime;
+       if(intermission)
+       {
+               if(announcer_countdown)
+               {
+                       centerprint_kill(ORDINAL(CPID_ROUND));
+                       if(announcer_countdown)
+                       {
+                               remove(announcer_countdown);
+                               announcer_countdown = NULL;
+                       }
+               }
+               return;
+       }
 
        if(previous_game_starttime != startTime)
        {