From: terencehill Date: Sun, 1 Jan 2012 21:57:57 +0000 (+0100) Subject: Fix blocked bots in arena games by calling Arena_Warmup in StartFrame rather than... X-Git-Tag: xonotic-v0.6.0~42^2~7^2~19 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a2c8a091d0de7fb28edc65c2dab3a0836dc52bdd;p=xonotic%2Fxonotic-data.pk3dir.git 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) --- 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;