Only reset CursorMovement to 0 if command "-cur_*" is called with appropriate direction
authorWuzzy <Wuzzy2@mail.ru>
Sun, 09 Sep 2018 12:25:23 +0200
changeset 13767 2e8b3081cf80
parent 13766 9fdb13633bcb
child 13768 c084bd440009
Only reset CursorMovement to 0 if command "-cur_*" is called with appropriate direction
hedgewars/uCommandHandlers.pas
--- a/hedgewars/uCommandHandlers.pas	Wed Sep 05 18:07:56 2018 +0200
+++ b/hedgewars/uCommandHandlers.pas	Sun Sep 09 12:25:23 2018 +0200
@@ -131,7 +131,8 @@
 procedure chCurU_m(var s: shortstring);
 begin
 s:= s; // avoid compiler hint
-CursorMovementY:= 0;
+if CursorMovementY < 0 then
+    CursorMovementY:= 0;
 end;
 
 procedure chCurD_p(var s: shortstring);
@@ -143,7 +144,8 @@
 procedure chCurD_m(var s: shortstring);
 begin
 s:= s; // avoid compiler hint
-CursorMovementY:= 0;
+if CursorMovementY > 0 then
+    CursorMovementY:= 0;
 end;
 
 procedure chCurL_p(var s: shortstring);
@@ -155,7 +157,8 @@
 procedure chCurL_m(var s: shortstring);
 begin
 s:= s; // avoid compiler hint
-CursorMovementX:= 0;
+if CursorMovementX < 0 then
+    CursorMovementX:= 0;
 end;
 
 procedure chCurR_p(var s: shortstring);
@@ -167,7 +170,8 @@
 procedure chCurR_m(var s: shortstring);
 begin
 s:= s; // avoid compiler hint
-CursorMovementX:= 0;
+if CursorMovementX > 0 then
+    CursorMovementX:= 0;
 end;
 
 procedure chLeft_p(var s: shortstring);