hedgewars/uGearsHandlersMess.pas
changeset 12656 161c10db4f27
parent 12644 59b46e6f36ff
child 12672 c98179b00740
--- a/hedgewars/uGearsHandlersMess.pas	Thu Oct 05 18:26:08 2017 +0200
+++ b/hedgewars/uGearsHandlersMess.pas	Fri Oct 06 14:03:13 2017 +0200
@@ -2865,6 +2865,7 @@
     valid:= false;
 
     lx:= Gear^.Target.X - SpritesData[sprHHTelepMask].Width  div 2; // left
+    lx:= CalcWorldWrap(lx, SpritesData[sprHHTelepMask].Width); // Take world edge into account
     ty:= Gear^.Target.Y - SpritesData[sprHHTelepMask].Height div 2; // top
 
     // remember original target location