diff options
author | rubidium <rubidium@openttd.org> | 2012-01-15 21:15:38 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2012-01-15 21:15:38 +0000 |
commit | 2a0754b67801e90ae4e5ca18cc4d0173d02f8cb0 (patch) | |
tree | c5181f4b9e2e7884cc00f1579205412af57f2147 | |
parent | 44ddde6fa1c3b6b5c921ec8540b50a9f0ca90a98 (diff) | |
download | openttd-2a0754b67801e90ae4e5ca18cc4d0173d02f8cb0.tar.xz |
(svn r23814) -Codechange: write the random-debug output directly to a file
-rw-r--r-- | src/core/random_func.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/core/random_func.cpp b/src/core/random_func.cpp index 042d137ff..5adc17066 100644 --- a/src/core/random_func.cpp +++ b/src/core/random_func.cpp @@ -63,11 +63,17 @@ void SetRandomSeed(uint32 seed) #include "../network/network_server.h" #include "../network/network_internal.h" #include "../company_func.h" +#include "../fileio_func.h" +#include "../date_func.h" uint32 DoRandom(int line, const char *file) { if (_networking && (!_network_server || (NetworkClientSocket::IsValidID(0) && NetworkClientSocket::Get(0)->status != NetworkClientSocket::STATUS_INACTIVE))) { - printf("Random [%d/%d] %s:%d\n", _frame_counter, (byte)_current_company, file, line); + static FILE *f = FioFOpenFile("random-out.log", "wb", AUTOSAVE_DIR); + if (f != NULL) { + fprintf(f, "%08x; %02x; %04x; %02x; %s:%d\n", _date, _date_fract, _frame_counter, (byte)_current_company, file, line); + fflush(f); + } } return _random.Next(); |