AI loves to jump
authorunc0rr
Thu, 14 Jun 2012 16:35:36 +0400
changeset 7250 304d3d98662e
parent 7248 0ee403b190b5
child 7252 74a92f39703b
AI loves to jump
hedgewars/uAI.pas
--- a/hedgewars/uAI.pas	Thu Jun 14 00:34:50 2012 +0200
+++ b/hedgewars/uAI.pas	Thu Jun 14 16:35:36 2012 +0400
@@ -284,9 +284,15 @@
                             AddAction(MadeActions, aia_LookRight, 0, 200, 0, 0);
                         end;
             if (BotLevel < 3) and (GoInfo.JumpType = jmpLJump) then // ljump support
+                begin
+                // push current position so we proceed from it after checking jump opportunities
+                if CanGo then Push(ticks, Actions, Me^, Me^.Message);
+                // first check where we go after jump
                 if Push(ticks, Actions, AltMe, Me^.Message) then
                     with Stack.States[Pred(Stack.Count)] do
                         AddAction(MadeActions, aia_LJump, 0, 305 + random(50), 0, 0);
+                break
+                end;
 
             // 'not CanGO' means we can't go straight, possible jumps are checked above
             if not CanGo then