hedgewars/uAIActions.pas
changeset 7433 c7fff3e61d49
parent 7416 2f2f78fc65a3
child 7671 43f38923bc6e
equal deleted inserted replaced
7430:9c132b368ddb 7433:c7fff3e61d49
   114 end;
   114 end;
   115 {$ENDIF}
   115 {$ENDIF}
   116 
   116 
   117 procedure AddAction(var Actions: TActions; Action: Longword; Param: LongInt; TimeDelta: Longword; X, Y: LongInt);
   117 procedure AddAction(var Actions: TActions; Action: Longword; Param: LongInt; TimeDelta: Longword; X, Y: LongInt);
   118 begin
   118 begin
   119 with Actions do
   119 if Actions.Count < MAXACTIONS then
   120     begin
   120     with Actions do
   121     actions[Count].Action:= Action;
   121         begin
   122     actions[Count].Param:= Param;
   122         actions[Count].Action:= Action;
   123     actions[Count].X:= X;
   123         actions[Count].Param:= Param;
   124     actions[Count].Y:= Y;
   124         actions[Count].X:= X;
   125     if Count > 0 then
   125         actions[Count].Y:= Y;
   126         actions[Count].Time:= TimeDelta
   126         if Count > 0 then
   127     else
   127             actions[Count].Time:= TimeDelta
   128         actions[Count].Time:= GameTicks + TimeDelta;
   128         else
   129     inc(Count);
   129             actions[Count].Time:= GameTicks + TimeDelta;
   130     TryDo(Count < MAXACTIONS, 'AI: actions overflow', true);
   130         inc(Count);
   131     end
   131         end
   132 end;
   132 end;
   133 
   133 
   134 procedure CheckHang(Me: PGear);
   134 procedure CheckHang(Me: PGear);
   135 begin
   135 begin
   136 if hwRound(Me^.X) <> PrevX then
   136 if hwRound(Me^.X) <> PrevX then