diff options
author | glx <glx@openttd.org> | 2009-03-30 00:21:43 +0000 |
---|---|---|
committer | glx <glx@openttd.org> | 2009-03-30 00:21:43 +0000 |
commit | 75c99d8b9b7db2cc723e2bfb98ed8a81cc5e3f6f (patch) | |
tree | be24c7a2e88a166f13ab937e7e836aa9f27254c7 /src/win32.cpp | |
parent | 8293be426cc8e4c6b228f906d00838d02f6edd0a (diff) | |
download | openttd-75c99d8b9b7db2cc723e2bfb98ed8a81cc5e3f6f.tar.xz |
(svn r15893) -Add: watermark crash.sav and don't generate crash information if a loaded crash.sav causes a crash
Diffstat (limited to 'src/win32.cpp')
-rw-r--r-- | src/win32.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/win32.cpp b/src/win32.cpp index 2b0857901..066ea628b 100644 --- a/src/win32.cpp +++ b/src/win32.cpp @@ -234,8 +234,15 @@ static const TCHAR _save_succeeded[] = _T("Be aware that critical parts of the internal game state may have become ") _T("corrupted. The saved game is not guaranteed to work."); +static const TCHAR _emergency_crash[] = + _T("A serious fault condition occured in the game. The game will shut down.\n") + _T("As you loaded an emergency savegame no crash information will be generated.\n"); + static bool EmergencySave() { + GamelogStartAction(GLAT_EMERGENCY); + GamelogEmergency(); + GamelogStopAction(); SaveOrLoad("crash.sav", SL_SAVE, BASE_DIR); return true; } @@ -471,6 +478,10 @@ static LONG WINAPI ExceptionHandler(EXCEPTION_POINTERS *ep) static bool had_exception = false; if (had_exception) ExitProcess(0); + if (GamelogTestEmergency()) { + MessageBox(NULL, _emergency_crash, _T("Fatal Application Failure"), MB_ICONERROR); + ExitProcess(0); + } had_exception = true; _ident = GetTickCount(); // something pretty unique |