Fix air mine spawning inside land if land is almost completely full
authorWuzzy <Wuzzy2@mail.ru>
Mon, 17 Jun 2019 20:20:01 +0200
changeset 15170 3cc1a79de3fd
parent 15169 f532203c5ceb
child 15171 2765731b378b
Fix air mine spawning inside land if land is almost completely full Bug conditions: * cAirMines >= 1 * Play with a drawn map filled with land
hedgewars/uGears.pas
--- a/hedgewars/uGears.pas	Mon Jun 17 19:51:05 2019 +0200
+++ b/hedgewars/uGears.pas	Mon Jun 17 20:20:01 2019 +0200
@@ -783,7 +783,7 @@
 
 i:= 0;
 j:= 0;
-p:= 0; // 0 searching, 1 bad position, 2 added.
+p:= 0; // 0: good position, 1: bad position.
 unplaced:= 0;
 if cAirMines > 0 then
     Gear:= AddGear(0, 0, gtAirMine, 0, _0, _0, 0);
@@ -835,7 +835,9 @@
                 if i < cAirMines then
                     Gear:= AddGear(0, 0, gtAirMine, 0, _0, _0, 0)
                 end
-            end;
+            end
+        else
+            p:= 1;
         inc(j)
         end;
 if p <> 0 then DeleteGear(Gear);