hedgewars/uAIActions.pas
changeset 15395 56f2c70723c8
parent 14512 184df3900ec4
child 15396 7a3d70c364fd
--- a/hedgewars/uAIActions.pas	Sun Sep 01 10:37:16 2019 +0200
+++ b/hedgewars/uAIActions.pas	Sun Sep 01 10:42:33 2019 +0200
@@ -206,21 +206,31 @@
                         CheckHang(Me);
                         exit
                         end;
-            aia_LookLeft:
+            aia_LookLeft: begin
+                if (Me^.State and gstMoving) <> 0 then
+                    exit;
+            
                 if not Me^.dX.isNegative then
-                    begin
-                    ParseCommand('+left', true);
+                begin
+                    if (Me^.Message and gmLeft) = 0 then
+                        ParseCommand('+left', true);
                     exit
                     end
                 else
                     ParseCommand('-left', true);
-            aia_LookRight:
+            end;
+            aia_LookRight: begin
+                if (Me^.State and gstMoving) <> 0 then
+                    exit;
+            
                 if Me^.dX.isNegative then
-                    begin
-                    ParseCommand('+right', true);
+                begin
+                    if (Me^.Message and gmRight) = 0 then
+                        ParseCommand('+right', true);
                     exit
                     end
                 else ParseCommand('-right', true);
+            end;
             aia_AwareExpl:
                 AwareOfExplosion(X, Y, Param);