]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Prevent concurrent game/round start countdown
authorterencehill <piuntn@gmail.com>
Sat, 9 Mar 2013 13:49:09 +0000 (14:49 +0100)
committerterencehill <piuntn@gmail.com>
Sat, 9 Mar 2013 13:49:09 +0000 (14:49 +0100)
qcsrc/client/announcer.qc

index dc4d7e2c5b0ff528afec43be43703ec71b74ca71..3397f84ac4c1b55b515d85021e73e936da8eb61e 100644 (file)
@@ -79,9 +79,13 @@ void Announcer_Gamestart()
 
                if(time < startTime) 
                {
-                       entity e;
-                       e = spawn();
-                       e.think = Announcer_Countdown;
+                       entity e = find(world, classname, "announcer_countdown");
+                       if not(e)
+                       {
+                               e = spawn();
+                               e.classname = "announcer_countdown";
+                               e.think = Announcer_Countdown;
+                       }
                        e.nextthink = startTime - floor(startTime - time); //synchronize nextthink to startTime
                }
        }