hedgewars/uAIActions.pas
changeset 66 9643d75baf1e
parent 64 9df467527ae5
child 70 82d93eeecebe
--- a/hedgewars/uAIActions.pas	Tue Jun 20 20:08:17 2006 +0000
+++ b/hedgewars/uAIActions.pas	Tue Jun 20 21:18:49 2006 +0000
@@ -54,7 +54,7 @@
      begin
      actions[Count].Action:= Action;
      actions[Count].Param:= Param;
-     if Count > 0 then actions[Count].Time:= actions[Pred(Count)].Time + TimeDelta
+     if Count > 0 then actions[Count].Time:= TimeDelta
                   else actions[Count].Time:= GameTicks + TimeDelta;
      inc(Count);
      TryDo(Count < MAXACTIONS, 'AI: actions overflow', true);
@@ -105,7 +105,9 @@
         ParseCommand(s)
         end
      end;
-inc(Actions.Pos)
+inc(Actions.Pos);
+if Actions.Pos <= Actions.Count then
+   inc(Actions.actions[Actions.Pos].Time, GameTicks)
 end;
 
 end.