hedgewars/uAI.pas
changeset 8036 89740f927254
parent 8017 70d386de989f
child 8096 453917e94e55
child 8677 afb2b467f801
--- a/hedgewars/uAI.pas	Thu Nov 15 13:57:29 2012 +0400
+++ b/hedgewars/uAI.pas	Thu Nov 15 13:58:49 2012 +0400
@@ -291,18 +291,13 @@
                     begin
                     with Stack.States[Pred(Stack.Count)] do
                         begin
-                        if Me^.dX.isNegative then
+                        if (Me^.Message and gmLeft) <> 0 then
                             AddAction(MadeActions, aia_LookRight, 0, 200, 0, 0)
                         else
                             AddAction(MadeActions, aia_LookLeft, 0, 200, 0, 0);
                             
                         AddAction(MadeActions, aia_HJump, 0, 305 + random(50), 0, 0);
                         AddAction(MadeActions, aia_HJump, 0, 350, 0, 0);
-                        
-                        if Me^.dX.isNegative then
-                            AddAction(MadeActions, aia_LookLeft, 0, 200, 0, 0)
-                        else
-                            AddAction(MadeActions, aia_LookRight, 0, 200, 0, 0);
                         end;
                     // but first check walking forward
                     Push(ticks, Stack.States[Pred(Stack.Count)].MadeActions, AltMe, Me^.Message)
@@ -318,7 +313,7 @@
                 if Push(ticks, Actions, AltMe, Me^.Message xor 3) then
                     with Stack.States[Pred(Stack.Count)] do
                         begin
-                        if Me^.dX.isNegative then
+                        if (Me^.Message and gmLeft) <> 0 then
                             AddAction(MadeActions, aia_LookLeft, 0, 200, 0, 0)
                         else
                             AddAction(MadeActions, aia_LookRight, 0, 200, 0, 0);