hedgewars/uAI.pas
changeset 7250 304d3d98662e
parent 7216 53f5e48b8375
child 7375 16ae2e1c9005
equal deleted inserted replaced
7248:0ee403b190b5 7250:304d3d98662e
   282                             AddAction(MadeActions, aia_LookLeft, 0, 200, 0, 0)
   282                             AddAction(MadeActions, aia_LookLeft, 0, 200, 0, 0)
   283                         else
   283                         else
   284                             AddAction(MadeActions, aia_LookRight, 0, 200, 0, 0);
   284                             AddAction(MadeActions, aia_LookRight, 0, 200, 0, 0);
   285                         end;
   285                         end;
   286             if (BotLevel < 3) and (GoInfo.JumpType = jmpLJump) then // ljump support
   286             if (BotLevel < 3) and (GoInfo.JumpType = jmpLJump) then // ljump support
       
   287                 begin
       
   288                 // push current position so we proceed from it after checking jump opportunities
       
   289                 if CanGo then Push(ticks, Actions, Me^, Me^.Message);
       
   290                 // first check where we go after jump
   287                 if Push(ticks, Actions, AltMe, Me^.Message) then
   291                 if Push(ticks, Actions, AltMe, Me^.Message) then
   288                     with Stack.States[Pred(Stack.Count)] do
   292                     with Stack.States[Pred(Stack.Count)] do
   289                         AddAction(MadeActions, aia_LJump, 0, 305 + random(50), 0, 0);
   293                         AddAction(MadeActions, aia_LJump, 0, 305 + random(50), 0, 0);
       
   294                 break
       
   295                 end;
   290 
   296 
   291             // 'not CanGO' means we can't go straight, possible jumps are checked above
   297             // 'not CanGO' means we can't go straight, possible jumps are checked above
   292             if not CanGo then
   298             if not CanGo then
   293                 break;
   299                 break;
   294             
   300