- Fix not debug build
authorunc0rr
Sun, 14 Jan 2007 21:51:17 +0000
changeset 337 a46abb65eb0c
parent 336 82d654db133d
child 338 d1e75dcd285f
- Fix not debug build - Allow multiple debug engines running simultaneously (there were problems with debug.txt)
hedgewars/uMisc.pas
--- a/hedgewars/uMisc.pas	Sun Jan 14 21:17:35 2007 +0000
+++ b/hedgewars/uMisc.pas	Sun Jan 14 21:51:17 2007 +0000
@@ -208,6 +208,12 @@
 if r >= 0 then r:= cLittle else r:= - cLittle 
 end;
 
+procedure SendStat(sit: TStatInfoType; s: shortstring);
+const stc: array [TStatInfoType] of char = 'rDK';
+begin
+SendIPC('i' + stc[sit] + s)
+end;
+
 {$IFDEF DEBUGFILE}
 procedure AddFileLog(s: shortstring);
 begin
@@ -220,15 +226,18 @@
 Result:= '(x: ' + inttostr(rect.x) + '; y: ' + inttostr(rect.y) + '; w: ' + inttostr(rect.w) + '; h: ' + inttostr(rect.h) + ')'
 end;
 
-procedure SendStat(sit: TStatInfoType; s: shortstring);
-const stc: array [TStatInfoType] of char = 'rDK';
-begin
-SendIPC('i' + stc[sit] + s)
-end;
+
+var i: integer;
 
 initialization
-AssignFile(f, 'debug.txt');
-rewrite(f);
+{$I-}
+for i:= 0 to 7 do
+    begin
+    AssignFile(f, 'debug' + inttostr(i) + '.txt');
+    rewrite(f);
+    if IOResult = 0 then break
+    end;
+{$I+}
 
 finalization
 writeln(f, '-= halt at ',GameTicks,' ticks =-');