]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Silence a warning when countdown number is higher than the available announcements
authorMario <mario@smbclan.net>
Fri, 18 Mar 2016 02:51:56 +0000 (12:51 +1000)
committerMario <mario@smbclan.net>
Fri, 18 Mar 2016 02:51:56 +0000 (12:51 +1000)
qcsrc/client/announcer.qc

index 12d07d15044dd50ea036f4b84c5a6fde75cbbf8d..016c87f326d298db2debceaeeb6688f8bc9670d0 100644 (file)
@@ -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));