From a2c8a091d0de7fb28edc65c2dab3a0836dc52bdd Mon Sep 17 00:00:00 2001 From: terencehill Date: Sun, 1 Jan 2012 22:57:57 +0100 Subject: [PATCH] Fix blocked bots in arena games by calling Arena_Warmup in StartFrame rather than in PlayerPostThink (reading its code it's cleaner to be executed there anyway) --- qcsrc/server/arena.qc | 24 ++++++++++++++---------- qcsrc/server/cl_client.qc | 2 -- qcsrc/server/sv_main.qc | 2 +- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/qcsrc/server/arena.qc b/qcsrc/server/arena.qc index d4614d43dd..6eaff6b795 100644 --- a/qcsrc/server/arena.qc +++ b/qcsrc/server/arena.qc @@ -196,7 +196,7 @@ void Spawnqueue_Mark(entity e) * Blocks the players movement while countdown is active. * Unblocks the player once the countdown is over. * - * Called in PlayerPostThink() + * Called in StartFrame() */ float roundStartTime_prev; // prevent networkspam void Arena_Warmup() @@ -252,12 +252,14 @@ void Arena_Warmup() } if (g_arena) { - if(self.spawned && self.classname == "player") - self.movetype = MOVETYPE_NONE; - - self.velocity = '0 0 0'; - self.avelocity = '0 0 0'; - self.movement = '0 0 0'; + FOR_EACH_CLIENT(e) + { + if(e.spawned && e.classname == "player") + e.movetype = MOVETYPE_NONE; + e.velocity = '0 0 0'; + e.avelocity = '0 0 0'; + e.movement = '0 0 0'; + } } } else if(f > -1 && f != roundStartTime_prev) @@ -280,9 +282,11 @@ void Arena_Warmup() ca_teams_ok = (start_red_ca_players && start_blue_ca_players); } - if(self.classname == "player" && self.health > 0 && self.movetype == MOVETYPE_NONE) - self.movetype = MOVETYPE_WALK; - + FOR_EACH_PLAYER(e) + { + if(e.health > 0 && e.movetype == MOVETYPE_NONE) + e.movetype = MOVETYPE_WALK; + } } // clear champion to avoid centerprinting again the champion msg diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index e8ccc07d73..afd7bc6526 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -2999,8 +2999,6 @@ void PlayerPostThink (void) } */ - Arena_Warmup(); - //pointparticles(particleeffectnum("machinegun_impact"), self.origin + self.view_ofs + '0 0 7', '0 0 0', 1); if(self.waypointsprite_attachedforcarrier) diff --git a/qcsrc/server/sv_main.qc b/qcsrc/server/sv_main.qc index cefba03749..2497b9d502 100644 --- a/qcsrc/server/sv_main.qc +++ b/qcsrc/server/sv_main.qc @@ -201,9 +201,9 @@ void StartFrame (void) skill = autocvar_skill; + Arena_Warmup(); Spawnqueue_Check(); - // detect when the pre-game countdown (if any) has ended and the game has started game_delay = (time < game_starttime) ? TRUE : FALSE; -- 2.39.2