# HG changeset patch
# User Wuzzy <Wuzzy2@mail.ru>
# Date 1554139015 -7200
# Node ID c760a2939b9c29565f92906ba2aa8cc38c2bc967
# Parent  52916435d9b14c87fdf6fef9f59872278dc44b83
Hedgehogs: Move setting of random pos to chAddHH

This fixes a problem that in missions, all hedgehogs start with Pos=0

diff -r 52916435d9b1 -r c760a2939b9c hedgewars/uGears.pas
--- a/hedgewars/uGears.pas	Mon Apr 01 18:49:08 2019 +0200
+++ b/hedgewars/uGears.pas	Mon Apr 01 19:16:55 2019 +0200
@@ -1004,7 +1004,6 @@
         if ar[i]^.Gear <> nil then
             begin
             ar[i]^.Gear^.dX.isNegative:= hwRound(ar[i]^.Gear^.X) > leftX + playWidth div 2;
-            ar[i]^.Gear^.Pos:= GetRandom(19)
             end;
         ar[i]:= ar[Count - 1];
         dec(Count)
diff -r 52916435d9b1 -r c760a2939b9c hedgewars/uTeams.pas
--- a/hedgewars/uTeams.pas	Mon Apr 01 18:49:08 2019 +0200
+++ b/hedgewars/uTeams.pas	Mon Apr 01 19:16:55 2019 +0200
@@ -736,6 +736,7 @@
     Gear:= AddGear(0, 0, gtHedgehog, 0, _0, _0, 0);
     SplitBySpace(s, id);
     Gear^.Health:= StrToInt(s);
+    Gear^.Pos:= GetRandom(19);
     if checkFails((Gear^.Health > 0) and (Gear^.Health <= cMaxHogHealth), 'Invalid hedgehog health (must be between 1 and '+IntToStr(cMaxHogHealth)+')', true) then exit;
     if (GameFlags and gfSharedAmmo) <> 0 then
         CurrentHedgehog^.AmmoStore:= Clan^.ClanIndex