Oops, this is right fix for assert
authorunc0rr
Sun, 20 Jan 2008 21:53:22 +0000
changeset 741 8bf8c0ac8d94
parent 740 5ac69a012b69
child 742 29609363c36c
Oops, this is right fix for assert
hedgewars/uAI.pas
hedgewars/uGame.pas
--- a/hedgewars/uAI.pas	Sun Jan 20 21:47:42 2008 +0000
+++ b/hedgewars/uAI.pas	Sun Jan 20 21:53:22 2008 +0000
@@ -325,7 +325,7 @@
            if (BestActions.Pos >= BestActions.Count)
               and (TurnTimeLeft > cStopThinkTime) then
               begin
-              TryDo((Gear^.Message = 0) and (gameType <> gmtSave), 'Engine bug: AI may break demos playing', true);
+              TryDo(Gear^.Message = 0, 'Engine bug: AI may break demos playing', true);
               StartThink(Gear);
               StartTicks:= GameTicks
               end else ProcessAction(BestActions, Gear)
--- a/hedgewars/uGame.pas	Sun Jan 20 21:47:42 2008 +0000
+++ b/hedgewars/uGame.pas	Sun Jan 20 21:53:22 2008 +0000
@@ -68,6 +68,7 @@
                gmtSave: begin
                         RestoreTeamsFromSave;
                         SetBinds(CurrentTeam^.Binds);
+                        CurrentHedgehog^.Gear^.Message:= 0;
                         isSoundEnabled:= isSEBackup;
                         GameType:= gmtLocal
                         end;