diff -r bc3306c59a08 -r 9bb6abdb5675 hedgewars/uAIActions.pas --- a/hedgewars/uAIActions.pas Fri Jul 13 16:39:20 2012 +0400 +++ b/hedgewars/uAIActions.pas Thu Jul 26 21:56:47 2012 +0400 @@ -44,6 +44,7 @@ aia_Wait = $8009; aia_Put = $800A; aia_waitAngle = $800B; + aia_waitAmmoXY = $800C; aim_push = $8000; aim_release = $8001; @@ -115,19 +116,19 @@ procedure AddAction(var Actions: TActions; Action: Longword; Param: LongInt; TimeDelta: Longword; X, Y: LongInt); begin -with Actions do - begin - actions[Count].Action:= Action; - actions[Count].Param:= Param; - actions[Count].X:= X; - actions[Count].Y:= Y; - if Count > 0 then - actions[Count].Time:= TimeDelta - else - actions[Count].Time:= GameTicks + TimeDelta; - inc(Count); - TryDo(Count < MAXACTIONS, 'AI: actions overflow', true); - end +if Actions.Count < MAXACTIONS then + with Actions do + begin + actions[Count].Action:= Action; + actions[Count].Param:= Param; + actions[Count].X:= X; + actions[Count].Y:= Y; + if Count > 0 then + actions[Count].Time:= TimeDelta + else + actions[Count].Time:= GameTicks + TimeDelta; + inc(Count); + end end; procedure CheckHang(Me: PGear); @@ -234,6 +235,10 @@ aia_waitAngle: if Me^.Angle <> Abs(Param) then exit; + + aia_waitAmmoXY: + if (CurAmmoGear <> nil) and ((hwRound(CurAmmoGear^.X) <> X) or (hwRound(CurAmmoGear^.Y) <> Y)) then exit; + end else begin