summaryrefslogtreecommitdiff
path: root/src/debug.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-01-11 00:30:32 +0000
committerrubidium <rubidium@openttd.org>2008-01-11 00:30:32 +0000
commit97d6e0e6c0bdada386ac68ffb95719721f1c54ce (patch)
tree05e3aa4702dd2e570adeaebdf8acd63559e5165f /src/debug.cpp
parent2ba5bf8947f8c879ed1f41cdd218c6271f626151 (diff)
downloadopenttd-97d6e0e6c0bdada386ac68ffb95719721f1c54ce.tar.xz
(svn r11811) -Fix: make compilation without networking work again (and thus move the debugdumpcommand stuff out of the network 'area').
Diffstat (limited to 'src/debug.cpp')
-rw-r--r--src/debug.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/debug.cpp b/src/debug.cpp
index 1b811b9cc..d6104f9b0 100644
--- a/src/debug.cpp
+++ b/src/debug.cpp
@@ -176,3 +176,20 @@ const char *GetDebugString()
return dbgstr;
}
+
+#ifdef DEBUG_DUMP_COMMANDS
+#include "fileio.h"
+
+void CDECL DebugDumpCommands(const char *s, ...)
+{
+ static FILE *f = FioFOpenFile("commands-out.log", "wb", AUTOSAVE_DIR);
+ if (f == NULL) return;
+
+ va_list va;
+ va_start(va, s);
+ vfprintf(f, s, va);
+ va_end(va);
+
+ fflush(f);
+}
+#endif /* DEBUG_DUMP_COMMANDS */