# HG changeset patch
# User unc0rr
# Date 1197833653 0
# Node ID 2aa3082937ac07f12205b0be600cdd7fc871e6ab
# Parent  28e294a496cb56efcc6f2052244265fa866bc924
Fix AI breaking demos and saves in some cases

diff -r 28e294a496cb -r 2aa3082937ac hedgewars/uAI.pas
--- a/hedgewars/uAI.pas	Sun Dec 16 19:16:22 2007 +0000
+++ b/hedgewars/uAI.pas	Sun Dec 16 19:34:13 2007 +0000
@@ -325,6 +325,7 @@
            if (BestActions.Pos >= BestActions.Count)
               and (TurnTimeLeft > cStopThinkTime) then
               begin
+              TryDo(Gear^.Message = 0, 'Engine bug: AI may break demos playing', true);
               StartThink(Gear);
               StartTicks:= GameTicks
               end else ProcessAction(BestActions, Gear)
diff -r 28e294a496cb -r 2aa3082937ac hedgewars/uAIActions.pas
--- a/hedgewars/uAIActions.pas	Sun Dec 16 19:16:22 2007 +0000
+++ b/hedgewars/uAIActions.pas	Sun Dec 16 19:34:13 2007 +0000
@@ -127,10 +127,10 @@
        end else
        begin
        inc(timedelta);
-       if timedelta > 2500 then
+       if timedelta > 2000 then
           begin
           timedelta:= 0;
-          Actions.Count:= 0
+          FreeActionsList
           end
        end
     end;