Wrap around target coordinates when clicking on other side of wrap-around world edge
authorWuzzy <Wuzzy2@mail.ru>
Sun, 22 Oct 2017 00:48:38 +0200
changeset 12736 7cbb0241d31c
parent 12735 83d62800d215
child 12737 d08afea02908
Wrap around target coordinates when clicking on other side of wrap-around world edge This fixes girder placement failure on other side (not across).
hedgewars/uIO.pas
--- a/hedgewars/uIO.pas	Sat Oct 21 23:59:31 2017 +0200
+++ b/hedgewars/uIO.pas	Sun Oct 22 00:48:38 2017 +0200
@@ -491,10 +491,12 @@
                 TargetPoint.X:= CursorPoint.X - WorldDx;
                 TargetPoint.Y:= cScreenHeight - CursorPoint.Y - WorldDy;
                 end;
+            TargetPoint.X:= CalcWorldWrap(TargetPoint.X, 0);
             SendIPCXY('p', TargetPoint.X, TargetPoint.Y);
             end
         else
             begin
+            TargetPoint.X:= CalcWorldWrap(TargetPoint.X, 0);
             TargetPoint.X:= putX;
             TargetPoint.Y:= putY
             end;