diff options
author | glx <glx@openttd.org> | 2008-06-05 20:54:52 +0000 |
---|---|---|
committer | glx <glx@openttd.org> | 2008-06-05 20:54:52 +0000 |
commit | b60a1326bf3ea9b9e0235cf18cdcd964c758a8bf (patch) | |
tree | 62bef57de81c1ddcc691d5de5e8db395615bdacc /src/network | |
parent | bb758700a87b19e47c6ef7aa28280ca05badd62f (diff) | |
download | openttd-b60a1326bf3ea9b9e0235cf18cdcd964c758a8bf.tar.xz |
(svn r13390) -Codechange: introduce usererror() for fatal but not openttd related errors. Now all error() will 'crash' openttd after showing the message in win32 releases (MSVC), creating a crash.log and crash.dmp (like the '!' hack used before). On the other hand, usererror() will just close the game. So use error() only when it can be helpful to debugging, else use usererror().
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/network_server.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/network/network_server.cpp b/src/network/network_server.cpp index 16f77f610..b0f3a98c8 100644 --- a/src/network/network_server.cpp +++ b/src/network/network_server.cpp @@ -323,12 +323,12 @@ DEF_SERVER_SEND_COMMAND(PACKET_SERVER_MAP) Packet *p; // Make a dump of the current game - if (SaveOrLoad(filename, SL_SAVE, AUTOSAVE_DIR) != SL_OK) error("network savedump failed"); + if (SaveOrLoad(filename, SL_SAVE, AUTOSAVE_DIR) != SL_OK) usererror("network savedump failed"); file_pointer = FioFOpenFile(filename, "rb", AUTOSAVE_DIR); fseek(file_pointer, 0, SEEK_END); - if (ftell(file_pointer) == 0) error("network savedump failed - zero sized savegame?"); + if (ftell(file_pointer) == 0) usererror("network savedump failed - zero sized savegame?"); // Now send the _frame_counter and how many packets are coming p = NetworkSend_Init(PACKET_SERVER_MAP); @@ -355,7 +355,7 @@ DEF_SERVER_SEND_COMMAND(PACKET_SERVER_MAP) p->Send_uint8(MAP_PACKET_NORMAL); res = (int)fread(p->buffer + p->size, 1, SEND_MTU - p->size, file_pointer); - if (ferror(file_pointer)) error("Error reading temporary network savegame!"); + if (ferror(file_pointer)) usererror("Error reading temporary network savegame!"); p->size += res; cs->Send_Packet(p); |