make the team association with hog before calling gear creation. makes some lua a little easier
authornemo
Tue, 03 Dec 2013 22:53:45 -0500
changeset 9749 443d233316e5
parent 9748 b0286b0c91ce
child 9750 8963312df207
make the team association with hog before calling gear creation. makes some lua a little easier
hedgewars/uTeams.pas
--- a/hedgewars/uTeams.pas	Tue Dec 03 22:48:21 2013 -0500
+++ b/hedgewars/uTeams.pas	Tue Dec 03 22:53:45 2013 -0500
@@ -542,11 +542,11 @@
     SplitBySpace(id, s);
     SwitchCurrentHedgehog(@Hedgehogs[HedgehogsNumber]);
     CurrentHedgehog^.BotLevel:= StrToInt(id);
+    CurrentHedgehog^.Team:= CurrentTeam;
     Gear:= AddGear(0, 0, gtHedgehog, 0, _0, _0, 0);
     SplitBySpace(s, id);
     Gear^.Health:= StrToInt(s);
     TryDo(Gear^.Health > 0, 'Invalid hedgehog health', true);
-    Gear^.Hedgehog^.Team:= CurrentTeam;
     if (GameFlags and gfSharedAmmo) <> 0 then
         CurrentHedgehog^.AmmoStore:= Clan^.ClanIndex
     else if (GameFlags and gfPerHogAmmo) <> 0 then