]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Don't play "Prepare for battle" announcement again when countdown to game start ends...
authorterencehill <piuntn@gmail.com>
Wed, 21 Jan 2015 23:09:21 +0000 (00:09 +0100)
committerterencehill <piuntn@gmail.com>
Wed, 21 Jan 2015 23:09:21 +0000 (00:09 +0100)
qcsrc/client/announcer.qc

index 35077496911a9ea8f8f56664068d3cd06437e3f0..f49b847d69d05c2a3bd8fecca9d932fe7ec95cc6 100644 (file)
@@ -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
                }
        }