# HG changeset patch # User Wuzzy # Date 1547391250 -3600 # Node ID 599f136d4f32a66fb855b1ca72496801115be20b # Parent ca9c632db2cfe2c933ab8991fc054985e207390f Don't try to spawn air mines beyond the bounce world edge diff -r ca9c632db2cf -r 599f136d4f32 hedgewars/uGears.pas --- a/hedgewars/uGears.pas Sun Jan 13 15:47:14 2019 +0100 +++ b/hedgewars/uGears.pas Sun Jan 13 15:54:10 2019 +0100 @@ -767,16 +767,14 @@ while (i < cAirMines) and (j < 1000*cAirMines) do begin p:= 0; + if (hasBorder) or (WorldEdge = weBounce) then + rx:= leftX+GetRandom(rightX-leftX-16)+8 + else + rx:= leftX+GetRandom(rightX-leftX+400)-200; if hasBorder then - begin - rx:= leftX+GetRandom(rightX-leftX-16)+8; ry:= topY+GetRandom(LAND_HEIGHT-topY-16)+8 - end else - begin - rx:= leftX+GetRandom(rightX-leftX+400)-200; - ry:= topY+GetRandom(LAND_HEIGHT-topY+400)-200 - end; + ry:= topY+GetRandom(LAND_HEIGHT-topY+400)-200; Gear^.X:= int2hwFloat(CalcWorldWrap(rx,Gear^.Radius)); Gear^.Y:= int2hwFloat(ry); if CheckLandValue(rx, ry, $FFFF) and