diff --git a/src/openttd.cpp b/src/openttd.cpp --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -62,6 +62,7 @@ #include "highscore.h" #include "thread/thread.h" #include "station_base.h" +#include "crashlog.h" #include "newgrf_commons.h" @@ -124,10 +125,9 @@ void CDECL error(const char *s, ...) ShowOSErrorBox(buf, true); if (_video_driver != NULL) _video_driver->Stop(); - /* Don't go into NOT_REACHED here; NOT_REACHED is using error, so - * using it would result in an infinite loop instead of errors. */ - assert(0); - exit(1); + /* Set the error message for the crash log and then invoke it. */ + CrashLog::SetErrorMessage(buf); + abort(); } /**