hedgewars/uAIActions.pas
changeset 66 9643d75baf1e
parent 64 9df467527ae5
child 70 82d93eeecebe
equal deleted inserted replaced
65:8c4c6ad6ca99 66:9643d75baf1e
    52 begin
    52 begin
    53 with Actions do
    53 with Actions do
    54      begin
    54      begin
    55      actions[Count].Action:= Action;
    55      actions[Count].Action:= Action;
    56      actions[Count].Param:= Param;
    56      actions[Count].Param:= Param;
    57      if Count > 0 then actions[Count].Time:= actions[Pred(Count)].Time + TimeDelta
    57      if Count > 0 then actions[Count].Time:= TimeDelta
    58                   else actions[Count].Time:= GameTicks + TimeDelta;
    58                   else actions[Count].Time:= GameTicks + TimeDelta;
    59      inc(Count);
    59      inc(Count);
    60      TryDo(Count < MAXACTIONS, 'AI: actions overflow', true);
    60      TryDo(Count < MAXACTIONS, 'AI: actions overflow', true);
    61      end
    61      end
    62 end;
    62 end;
   103              end
   103              end
   104           else if Param <> 0 then s:= s + ' ' + inttostr(Param);
   104           else if Param <> 0 then s:= s + ' ' + inttostr(Param);
   105         ParseCommand(s)
   105         ParseCommand(s)
   106         end
   106         end
   107      end;
   107      end;
   108 inc(Actions.Pos)
   108 inc(Actions.Pos);
       
   109 if Actions.Pos <= Actions.Count then
       
   110    inc(Actions.actions[Actions.Pos].Time, GameTicks)
   109 end;
   111 end;
   110 
   112 
   111 end.
   113 end.