hedgewars/uAI.pas
changeset 936 ba582673db7d
parent 883 07a568ba44e0
child 941 b5222ddafe1f
--- a/hedgewars/uAI.pas	Fri May 16 13:21:18 2008 +0000
+++ b/hedgewars/uAI.pas	Sat May 17 11:36:24 2008 +0000
@@ -329,7 +329,12 @@
            if (BestActions.Pos >= BestActions.Count)
               and (TurnTimeLeft > cStopThinkTime) then
               begin
-              TryDo(Gear^.Message = 0, 'Engine bug: AI may break demos playing', true);
+              if Gear^.Message <> 0 then
+                 begin
+                 StopMessages(Gear^.Message);
+                 TryDo((Gear^.Message and gmAllStoppable) = 0, 'Engine bug: AI may break demos playing', true);
+                 end;
+              if Gear^.Message <> 0 then exit;
               StartThink(Gear);
               StartTicks:= GameTicks
               end else ProcessAction(BestActions, Gear)