]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/round_handler.qc
Merge branch 'master' into LegendaryGuard/cyber
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / round_handler.qc
index 5307eca782a827398f66eed801fdd73682d458b4..b30242813cec42c098eca227ebb422519eed7ad9 100644 (file)
@@ -8,6 +8,8 @@
 
 void round_handler_Think(entity this)
 {
+       if (game_timeout) { this.nextthink = time + 1; return; }
+       
        if (intermission_running)
        {
                round_handler_Reset(0);
@@ -42,6 +44,7 @@ void round_handler_Think(entity this)
                                this.cnt = 0;
                                this.round_endtime = (this.round_timelimit) ? time + this.round_timelimit : 0;
                                this.nextthink = time;
+                               FOREACH_CLIENT(IS_PLAYER(it), { roundaccuracy_clear(it); });
                                if (this.roundStart) this.roundStart();
                                return;
                        }
@@ -95,13 +98,25 @@ void round_handler_Spawn(bool() canRoundStart_func, bool() canRoundEnd_func, voi
        }
        entity this = round_handler = new_pure(round_handler);
 
-       setthink(this, round_handler_FirstThink);
+       
        this.canRoundStart = canRoundStart_func;
        this.canRoundEnd = canRoundEnd_func;
        this.roundStart = roundStart_func;
        this.wait = false;
        round_handler_Init(5, 5, 180);
-       this.nextthink = time;
+       
+}
+
+void round_handler_Activate(bool active) {
+       if (round_handler) {
+               entity this = round_handler;
+       
+               this.isactive = active;
+               if(active) {
+                       setthink(this, round_handler_FirstThink);
+                       this.nextthink = time;
+               }
+       }
 }
 
 void round_handler_Reset(float next_think)