hedgewars/uUtils.pas
changeset 13312 092adcf707c5
parent 13089 c9cdbf630447
child 13844 94d0d1ab7a0e
--- a/hedgewars/uUtils.pas	Fri Apr 06 12:34:23 2018 -0400
+++ b/hedgewars/uUtils.pas	Sat Apr 07 22:16:36 2018 +0200
@@ -751,9 +751,14 @@
 procedure freeModule;
 begin
 {$IFDEF DEBUGFILE}
+if logFile <> nil then
+    begin
     pfsWriteLn(logFile, 'halt at ' + inttostr(GameTicks) + ' ticks. TurnTimeLeft = ' + inttostr(TurnTimeLeft));
     pfsFlush(logFile);
     pfsClose(logFile);
+    end
+else
+    WriteLn(stdout, 'halt at ' + inttostr(GameTicks) + ' ticks. TurnTimeLeft = ' + inttostr(TurnTimeLeft));
 {$IFDEF USE_VIDEO_RECORDING}
     DoneCriticalSection(logMutex);
 {$ENDIF}