diff options
author | rubidium <rubidium@openttd.org> | 2008-01-11 00:30:32 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-01-11 00:30:32 +0000 |
commit | 97d6e0e6c0bdada386ac68ffb95719721f1c54ce (patch) | |
tree | 05e3aa4702dd2e570adeaebdf8acd63559e5165f /src/debug.cpp | |
parent | 2ba5bf8947f8c879ed1f41cdd218c6271f626151 (diff) | |
download | openttd-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.cpp | 17 |
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 */ |