Add checkins so that spawning on top of things is possible too
authornemo
Wed, 09 Aug 2017 15:35:39 -0400
changeset 12452 ac710bb12fbb
parent 12451 48ee3777e42e
child 12453 8b89fe2115ad
Add checkins so that spawning on top of things is possible too
hedgewars/uGears.pas
--- a/hedgewars/uGears.pas	Wed Aug 09 12:46:52 2017 -0400
+++ b/hedgewars/uGears.pas	Wed Aug 09 15:35:39 2017 -0400
@@ -650,7 +650,10 @@
     if Gear = nil then
         inc(unplaced)
     else
+        begin
         unplaced:= 0;
+        AddCI(Gear)
+        end;
 
     inc(i)
     end;
@@ -882,6 +885,7 @@
                                     FindPlace(Gear, false, t, t + playWidth div ClansCount, true);// could make Gear == nil;
                                 if Gear <> nil then
                                     begin
+                                    AddCI(Gear);
                                     Gear^.Pos:= GetRandom(49);
                                     // unless the world is wrapping, make outter teams face to map center
                                     if (WorldEdge <> weWrap) and ((p = 0) or (p = ClansCount - 1)) then
@@ -916,6 +920,7 @@
             FindPlace(ar[i]^.Gear, false, leftX, rightX, true);
         if ar[i]^.Gear <> nil then
             begin
+            AddCI(ar[i]^.Gear);
             ar[i]^.Gear^.dX.isNegative:= hwRound(ar[i]^.Gear^.X) > leftX + playWidth div 2;
             ar[i]^.Gear^.Pos:= GetRandom(19)
             end;
@@ -943,6 +948,7 @@
                                      hwRound(Gear^.Y) - SpritesData[sprTargetBee].Height div 2, 
                                      sprTargetBee, 0, lfBasic, $FFFFFFFF, false, false, false);
                     Gear^.Y:= int2hwFloat(hwRound(Gear^.Y) - 16 - Gear^.Radius);
+                    AddCI(Gear);
                     Gear^.State:= Gear^.State and (not gsttmpFlag);
                     AddFileLog('Placed flower for hog at coordinates (' + inttostr(hwRound(Gear^.X)) + ',' + inttostr(hwRound(Gear^.Y)) + ')')
                     end;