hedgewars/uGears.pas
changeset 15645 fb1f47e382d0
parent 15639 afeffdb4a712
child 15709 6b04399c84a7
--- a/hedgewars/uGears.pas	Sun Jun 28 00:47:43 2020 +0300
+++ b/hedgewars/uGears.pas	Sun Jun 28 01:06:18 2020 +0300
@@ -863,6 +863,21 @@
         end;
 if p <> 0 then DeleteGear(Gear);
 
+i:= 0;
+unplaced:= 0;
+while (i < cSentries) and (unplaced < 4) do
+    begin
+        Gear:= AddGear(0, 0, gtSentry, 0, _0, _0, 0);
+        FindPlace(Gear, false, 0, LAND_WIDTH);
+
+        if Gear = nil then
+            inc(unplaced)
+        else
+            unplaced:= 0;
+
+        inc(i)
+    end;
+
 if (GameFlags and gfLowGravity) <> 0 then
     begin
     cGravity:= cMaxWindSpeed;