]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix blocked bots in arena games by calling Arena_Warmup in StartFrame rather than...
authorterencehill <piuntn@gmail.com>
Sun, 1 Jan 2012 21:57:57 +0000 (22:57 +0100)
committerterencehill <piuntn@gmail.com>
Sun, 1 Jan 2012 23:18:14 +0000 (00:18 +0100)
qcsrc/server/arena.qc
qcsrc/server/cl_client.qc
qcsrc/server/sv_main.qc

index d4614d43dda8f0b78a05a6be40625d5f8e0c3c27..6eaff6b79522c5eaeedc33ad2588e414dc561485 100644 (file)
@@ -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
index e8ccc07d73330760e9d856b0ca217c30f8c0df56..afd7bc652696a468bf0bfa7afdcbf2bd406795ef 100644 (file)
@@ -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)
index cefba03749ef3569be327dba9186025528d9c728..2497b9d502854f663d65f3fd6779c54d723a46f5 100644 (file)
@@ -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;