hedgewars/uAIActions.pas
changeset 433 9f8f22094c0e
parent 393 db01cc79f278
child 543 465e2ec8f05f
--- a/hedgewars/uAIActions.pas	Sun Feb 11 12:27:45 2007 +0000
+++ b/hedgewars/uAIActions.pas	Sun Feb 11 15:33:19 2007 +0000
@@ -59,7 +59,7 @@
 procedure ProcessAction(var Actions: TActions; Me: PGear);
 
 implementation
-uses uMisc, uTeams, uConsts, uConsole, uAIMisc;
+uses uMisc, uTeams, uConsts, uConsole, uAIMisc, uAI;
 
 const ActionIdToStr: array[0..6] of string[16] = (
 {aia_none}           '',
@@ -150,14 +150,16 @@
                           else if hwRound(Me^.X) < Param then
                                begin
                                OutError('AI: WaitXL assert', false);
-                               Actions.Count:= 0
+                               FreeActionsList;
+                               exit
                                end
                           else begin CheckHang; exit end;
            aia_WaitXR: if hwRound(Me^.X) = Param then Time:= GameTicks
                           else if hwRound(Me^.X) > Param then
                                begin
                                OutError('AI: WaitXR assert', false);
-                               Actions.Count:= 0
+                               FreeActionsList;
+                               exit
                                end
                           else begin CheckHang; exit end;
          aia_LookLeft: if not Me^.dX.isNegative then