Fix air mine spawning inside land if land is almost completely full
Bug conditions:
* cAirMines >= 1
* Play with a drawn map filled with land
--- 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);