]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Optimize round restarting code and fix some modes (temporary hack)
authorMario <mario@smbclan.net>
Mon, 9 Jan 2017 08:22:23 +0000 (18:22 +1000)
committerMario <mario@smbclan.net>
Mon, 9 Jan 2017 08:22:23 +0000 (18:22 +1000)
qcsrc/server/command/vote.qc
qcsrc/server/round_handler.qc

index f855b2f067f268e71563ad6f77ce97707c6540aa..e6cd4c154b6e13286be160c1f13ed13ab5836101 100644 (file)
@@ -367,28 +367,26 @@ void reset_map(bool dorespawn)
        {
                if (!MUTATOR_CALLHOOK(reset_map_players))
                {
-                       FOREACH_CLIENT(true, LAMBDA(
-                               /*
-                               only reset players if a restart countdown is active
-                               this can either be due to cvar sv_ready_restart_after_countdown having set
-                               restart_mapalreadyrestarted to 1 after the countdown ended or when
-                               sv_ready_restart_after_countdown is not used and countdown is still running
-                               */
-                               if (restart_mapalreadyrestarted || (time < game_starttime))
+                       //if (restart_mapalreadyrestarted || (time < game_starttime))
+                       //{
+                               FOREACH_CLIENT(IS_PLAYER(it),
                                {
+                                       /*
+                                       only reset players if a restart countdown is active
+                                       this can either be due to cvar sv_ready_restart_after_countdown having set
+                                       restart_mapalreadyrestarted to 1 after the countdown ended or when
+                                       sv_ready_restart_after_countdown is not used and countdown is still running
+                                       */
                                        // NEW: changed behaviour so that it prevents that previous spectators/observers suddenly spawn as players
-                                       if (IS_PLAYER(it))
-                                       {
-                                               // PlayerScore_Clear(it);
-                                               it.killcount = 0;
-                                               // stop the player from moving so that he stands still once he gets respawned
-                                               it.velocity = '0 0 0';
-                                               it.avelocity = '0 0 0';
-                                               it.movement = '0 0 0';
-                                               PutClientInServer(it);
-                                       }
-                               }
-                       ));
+                                       // PlayerScore_Clear(it);
+                                       it.killcount = 0;
+                                       // stop the player from moving so that he stands still once he gets respawned
+                                       it.velocity = '0 0 0';
+                                       it.avelocity = '0 0 0';
+                                       it.movement = '0 0 0';
+                                       PutClientInServer(it);
+                               });
+                       //}
                }
        }
 }
index cbfc7c79d8c6b4411a78fc6137d55c168815afc3..c26bf629c7d8dd4235e7c9d65d1736502b07bc6a 100644 (file)
@@ -19,8 +19,7 @@ void round_handler_Think(entity this)
                return;
        }
 
-       if (game_stopped)
-               game_stopped = false;
+       game_stopped = false;
 
        if (this.wait)
        {