summaryrefslogtreecommitdiff
path: root/src/win32.cpp
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2008-06-05 20:54:52 +0000
committerglx <glx@openttd.org>2008-06-05 20:54:52 +0000
commitee256e770afb5f04a6a10f3b2045dd426d3167ff (patch)
tree62bef57de81c1ddcc691d5de5e8db395615bdacc /src/win32.cpp
parent5176319dd5145138604dd48c44b056693d900b10 (diff)
downloadopenttd-ee256e770afb5f04a6a10f3b2045dd426d3167ff.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/win32.cpp')
-rw-r--r--src/win32.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/win32.cpp b/src/win32.cpp
index 5fa7edc82..e2e02d905 100644
--- a/src/win32.cpp
+++ b/src/win32.cpp
@@ -92,14 +92,14 @@ void SetExceptionString(const char *s, ...)
}
#endif
-void ShowOSErrorBox(const char *buf)
+void ShowOSErrorBox(const char *buf, bool system)
{
MyShowCursor(true);
MessageBox(GetActiveWindow(), MB_TO_WIDE(buf), _T("Error!"), MB_ICONSTOP);
/* if exception tracker is enabled, we crash here to let the exception handler handle it. */
#if defined(WIN32_EXCEPTION_TRACKER) && !defined(_DEBUG)
- if (*buf == '!') {
+ if (system) {
_exception_string = buf;
*(byte*)0 = 0;
}
@@ -961,7 +961,7 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi
#if !defined(WINCE)
/* Check if a win9x user started the win32 version */
- if (HasBit(GetVersion(), 31)) error("This version of OpenTTD doesn't run on windows 95/98/ME.\nPlease download the win9x binary and try again.");
+ if (HasBit(GetVersion(), 31)) usererror("This version of OpenTTD doesn't run on windows 95/98/ME.\nPlease download the win9x binary and try again.");
#endif
/* For UNICODE we need to convert the commandline to char* _AND_