Fix weird bots behavior on low fps
authorunc0rr
Sun, 19 Nov 2006 12:11:28 +0000
changeset 250 d7f744a9bf28
parent 249 ff85fa029541
child 251 e4058e1ba394
Fix weird bots behavior on low fps
hedgewars/uAI.pas
--- a/hedgewars/uAI.pas	Sat Nov 18 23:48:24 2006 +0000
+++ b/hedgewars/uAI.pas	Sun Nov 19 12:11:28 2006 +0000
@@ -133,11 +133,17 @@
                   begin
                   AddAction(MadeActions, aia_HJump, 0, 305);
                   AddAction(MadeActions, aia_HJump, 0, 350);
+                  if (Me.dX < 0) then AddAction(MadeActions, aia_WaitXL, round(AltMe.X), 0)
+                                 else AddAction(MadeActions, aia_WaitXR, round(AltMe.X), 0);
                   end;
        if (BotLevel < 3) and (GoInfo.JumpType = jmpLJump) then // ljump support
           if Push(ticks, Actions, AltMe, Me^.Message) then
              with ThinkStack.States[Pred(ThinkStack.Count)] do
+                  begin
                   AddAction(MadeActions, aia_LJump, 0, 305);
+                  if (Me.dX < 0) then AddAction(MadeActions, aia_WaitXL, round(AltMe.X), 0)
+                                 else AddAction(MadeActions, aia_WaitXR, round(AltMe.X), 0);
+                  end;
 
        if not CanGo then break;
        inc(steps);