]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/announcer.qc
Not much to do in announcer.qc
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / announcer.qc
index 35077496911a9ea8f8f56664068d3cd06437e3f0..e4fb87d24730c6e3828dd811fbee8f232aebcfce 100644 (file)
@@ -1,5 +1,5 @@
-float announcer_1min;
-float announcer_5min;
+bool announcer_1min;
+bool announcer_5min;
 void Announcer_Countdown()
 {
        float starttime = getstatf(STAT_GAMESTARTTIME);
@@ -27,6 +27,7 @@ void Announcer_Countdown()
        }
        else // countdown is still going
        {
+               // if concomitant countdown to round start overrides countdown to game start
                if(roundstarttime == starttime)
                {
                        Local_Notification(MSG_CENTER, CENTER_COUNTDOWN_ROUNDSTART, countdown_rounded);
@@ -59,9 +60,6 @@ void Announcer_Gamestart()
 
        if(previous_game_starttime != startTime)
        {
-               if((time + 5.0) < startTime) // if connecting to server while restart was active don't always play prepareforbattle
-                       Local_Notification(MSG_ANNCE, ANNCE_PREPARE);
-
                if(time < startTime)
                {
                        entity e = find(world, classname, "announcer_countdown");
@@ -71,6 +69,11 @@ void Announcer_Gamestart()
                                e.classname = "announcer_countdown";
                                e.think = Announcer_Countdown;
                        }
+
+                       if(time + 5.0 < startTime) // if connecting to server while restart was active don't always play prepareforbattle
+                       if(time > e.nextthink) // don't play it again if countdown was already going
+                               Local_Notification(MSG_ANNCE, ANNCE_PREPARE);
+
                        e.nextthink = startTime - floor(startTime - time); //synchronize nextthink to startTime
                }
        }