add wrap check
authornemo
Sun, 29 Jul 2018 11:32:56 -0400
changeset 13569 7d2e2a5d4bff
parent 13568 470982c05f7e
child 13570 5190d41a2440
add wrap check
hedgewars/uGears.pas
--- a/hedgewars/uGears.pas	Sat Jul 28 12:58:12 2018 -0400
+++ b/hedgewars/uGears.pas	Sun Jul 29 11:32:56 2018 -0400
@@ -671,7 +671,7 @@
         rx:= leftX+GetRandom(rightX-leftX+400)-200;
         ry:= topY+GetRandom(LAND_HEIGHT-topY+400)-200
         end;
-    Gear^.X:= int2hwFloat(rx);
+    Gear^.X:= int2hwFloat(CalcWorldWrap(rx,Gear^.Radius));
     Gear^.Y:= int2hwFloat(ry);
     if CheckLandValue(rx, ry, $FFFF) and
        (TestCollisionYwithGear(Gear,-1) = 0) and