Enable crashlogs for emergency or missing NewGRF savegames, in dev mode.
Factor out common checks for emergency and missing NewGRFs.
This commit is contained in:
@@ -540,23 +540,15 @@ static LONG WINAPI ExceptionHandler(EXCEPTION_POINTERS *ep)
|
||||
ExitProcess(2);
|
||||
}
|
||||
|
||||
if (GamelogTestEmergency()) {
|
||||
static const TCHAR _emergency_crash[] =
|
||||
_T("A serious fault condition occurred in the game. The game will shut down.\n")
|
||||
_T("As you loaded an emergency savegame no crash information will be generated.\n");
|
||||
const char *abort_reason = CrashLog::GetAbortCrashlogReason();
|
||||
if (abort_reason != NULL) {
|
||||
TCHAR _emergency_crash[512];
|
||||
_sntprintf(_emergency_crash, lengthof(_emergency_crash),
|
||||
_T("A serious fault condition occurred in the game. The game will shut down.\n"), OTTD2FS(abort_reason));
|
||||
MessageBox(NULL, _emergency_crash, _T("Fatal Application Failure"), MB_ICONERROR);
|
||||
ExitProcess(3);
|
||||
}
|
||||
|
||||
if (SaveloadCrashWithMissingNewGRFs()) {
|
||||
static const TCHAR _saveload_crash[] =
|
||||
_T("A serious fault condition occurred in the game. The game will shut down.\n")
|
||||
_T("As you loaded an savegame for which you do not have the required NewGRFs\n")
|
||||
_T("no crash information will be generated.\n");
|
||||
MessageBox(NULL, _saveload_crash, _T("Fatal Application Failure"), MB_ICONERROR);
|
||||
ExitProcess(3);
|
||||
}
|
||||
|
||||
CrashLogWindows *log = new CrashLogWindows(ep);
|
||||
CrashLogWindows::current = log;
|
||||
char *buf = log->FillCrashLog(log->crashlog, lastof(log->crashlog));
|
||||
|
Reference in New Issue
Block a user