mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-08 01:10:28 +00:00
(svn r23814) -Codechange: write the random-debug output directly to a file
This commit is contained in:
parent
44ddde6fa1
commit
2a0754b678
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user