# HG changeset patch # User sheepluva # Date 1418287831 -3600 # Node ID 4456836514edb4a82c30962f3effa63cf43eb9af # Parent 7a8e321be3bdff1f92375ba1e574359f9c64f11d wrap sinegun diff -r 7a8e321be3bd -r 4456836514ed hedgewars/uGearsHandlersMess.pas --- a/hedgewars/uGearsHandlersMess.pas Thu Dec 11 01:39:29 2014 +0100 +++ b/hedgewars/uGearsHandlersMess.pas Thu Dec 11 09:50:31 2014 +0100 @@ -4618,6 +4618,20 @@ x := hwRound(Gear^.X); y := hwRound(Gear^.Y); + if WorldEdge = weWrap then + begin + if x > LongInt(rightX) then + repeat; + dec(x, playWidth); + dec(rx, playWidth); + until x <= LongInt(rightX) + else if x < LongInt(leftX) then + repeat; + inc(x, playWidth); + inc(rx, playWidth); + until x >= LongInt(leftX); + end; + // if borders are on, stop outside land array if hasBorder and (((x and LAND_WIDTH_MASK) <> 0) or ((y and LAND_HEIGHT_MASK) <> 0)) then begin