hedgewars/uGears.pas
changeset 12455 8e32d540dab5
parent 12452 ac710bb12fbb
child 12626 d972b31f8881
equal deleted inserted replaced
12454:8c5475bb4db7 12455:8e32d540dab5
   883                                     Unplaced:= true
   883                                     Unplaced:= true
   884                                 else
   884                                 else
   885                                     FindPlace(Gear, false, t, t + playWidth div ClansCount, true);// could make Gear == nil;
   885                                     FindPlace(Gear, false, t, t + playWidth div ClansCount, true);// could make Gear == nil;
   886                                 if Gear <> nil then
   886                                 if Gear <> nil then
   887                                     begin
   887                                     begin
   888                                     AddCI(Gear);
   888                                     //AddCI(Gear);  uncomment if new hogs should be able to spawn on top of old ones.
   889                                     Gear^.Pos:= GetRandom(49);
   889                                     Gear^.Pos:= GetRandom(49);
   890                                     // unless the world is wrapping, make outter teams face to map center
   890                                     // unless the world is wrapping, make outter teams face to map center
   891                                     if (WorldEdge <> weWrap) and ((p = 0) or (p = ClansCount - 1)) then
   891                                     if (WorldEdge <> weWrap) and ((p = 0) or (p = ClansCount - 1)) then
   892                                         Gear^.dX.isNegative:= (p <> 0)
   892                                         Gear^.dX.isNegative:= (p <> 0)
   893                                     else
   893                                     else
   918             ar[i]^.Unplaced:= true
   918             ar[i]^.Unplaced:= true
   919         else
   919         else
   920             FindPlace(ar[i]^.Gear, false, leftX, rightX, true);
   920             FindPlace(ar[i]^.Gear, false, leftX, rightX, true);
   921         if ar[i]^.Gear <> nil then
   921         if ar[i]^.Gear <> nil then
   922             begin
   922             begin
   923             AddCI(ar[i]^.Gear);
   923             //AddCI(ar[i]^.Gear); uncomment if new hogs should be able to spawn on top of old ones
   924             ar[i]^.Gear^.dX.isNegative:= hwRound(ar[i]^.Gear^.X) > leftX + playWidth div 2;
   924             ar[i]^.Gear^.dX.isNegative:= hwRound(ar[i]^.Gear^.X) > leftX + playWidth div 2;
   925             ar[i]^.Gear^.Pos:= GetRandom(19)
   925             ar[i]^.Gear^.Pos:= GetRandom(19)
   926             end;
   926             end;
   927         ar[i]:= ar[Count - 1];
   927         ar[i]:= ar[Count - 1];
   928         dec(Count)
   928         dec(Count)