hedgewars/uIO.pas
changeset 11537 bf86c6cb9341
parent 11512 bd9a2f1b0080
child 11544 c22d292e7266
--- a/hedgewars/uIO.pas	Sun Jan 24 00:02:57 2016 +0100
+++ b/hedgewars/uIO.pas	Sun Jan 31 16:07:14 2016 +0300
@@ -102,7 +102,6 @@
 procedure RemoveCmd;
 var tmp: PCmd;
 begin
-TryDo(headcmd <> nil, 'Engine bug: headcmd = nil', true);
 tmp:= headcmd;
 headcmd:= headcmd^.Next;
 if headcmd = nil then
@@ -224,7 +223,8 @@
 {$I-}
 assign(f, fileName);
 reset(f, 1);
-tryDo(IOResult = 0, 'Error opening file ' + fileName, true);
+if checkFails(IOResult = 0, 'Error opening file ' + fileName, true) then
+    exit;
 
 i:= 0; // avoid compiler hints
 s[0]:= #0;
@@ -435,7 +435,7 @@
     end;
 
 if (headcmd <> nil) and tmpflag and (not CurrentTeam^.hasGone) then
-    TryDo(GameTicks < LongWord(hiTicks shl 16) + headcmd^.loTime,
+    checkFails(GameTicks < LongWord(hiTicks shl 16) + headcmd^.loTime,
             'oops, queue error. in buffer: ' + headcmd^.cmd +
             ' (' + IntToStr(GameTicks) + ' > ' +
             IntToStr(hiTicks shl 16 + headcmd^.loTime) + ')',