No more AI jumping lulz
authorunc0rr
Thu, 26 Jul 2012 11:56:58 +0400
changeset 7446 9ce6e2c35413
parent 7441 5d64f59f2ca5
child 7450 4be946b65a85
No more AI jumping lulz
hedgewars/uAI.pas
--- a/hedgewars/uAI.pas	Thu Jul 26 11:56:43 2012 +0400
+++ b/hedgewars/uAI.pas	Thu Jul 26 11:56:58 2012 +0400
@@ -274,7 +274,8 @@
                 break;
 
             if (BotLevel < 5) and (GoInfo.JumpType = jmpHJump) then // hjump support
-                if Push(ticks, Actions, AltMe, Me^.Message) then
+                // check if we could go backwards and maybe ljump over a gap after this hjump
+                if Push(ticks, Actions, AltMe, Me^.Message xor 3) then
                     begin
                     with Stack.States[Pred(Stack.Count)] do
                         begin
@@ -291,9 +292,8 @@
                         else
                             AddAction(MadeActions, aia_LookRight, 0, 200, 0, 0);
                         end;
-                    
-                    // check if we could go backwards and maybe ljump over a gap after this hjump
-                    Push(ticks, Stack.States[Pred(Stack.Count)].MadeActions, AltMe, Me^.Message xor 3)
+                    // but first check walking forward
+                    Push(ticks, Stack.States[Pred(Stack.Count)].MadeActions, AltMe, Me^.Message)
                     end;
             if (BotLevel < 3) and (GoInfo.JumpType = jmpLJump) then // ljump support
                 begin