summaryrefslogtreecommitdiff
path: root/src/newgrf.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
commitb60a1326bf3ea9b9e0235cf18cdcd964c758a8bf (patch)
tree62bef57de81c1ddcc691d5de5e8db395615bdacc /src/newgrf.cpp
parentbb758700a87b19e47c6ef7aa28280ca05badd62f (diff)
downloadopenttd-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/newgrf.cpp')
-rw-r--r--src/newgrf.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp
index aa7496b92..5fe787877 100644
--- a/src/newgrf.cpp
+++ b/src/newgrf.cpp
@@ -5783,7 +5783,7 @@ void LoadNewGRFFile(GRFConfig *config, uint file_index, GrfLoadingStage stage)
* processed once at initialization. */
if (stage != GLS_FILESCAN && stage != GLS_SAFETYSCAN && stage != GLS_LABELSCAN) {
_cur_grffile = GetFileByFilename(filename);
- if (_cur_grffile == NULL) error("File '%s' lost in cache.\n", filename);
+ if (_cur_grffile == NULL) usererror("File '%s' lost in cache.\n", filename);
if (stage == GLS_RESERVE && config->status != GCS_INITIALISED) return;
if (stage == GLS_ACTIVATION && !HasBit(config->flags, GCF_RESERVED)) return;
_cur_grffile->is_ottdfile = config->IsOpenTTDBaseGRF();
@@ -5989,7 +5989,7 @@ void LoadNewGRF(uint load_index, uint file_index)
if (stage > GLS_INIT && HasBit(c->flags, GCF_INIT_ONLY)) continue;
/* @todo usererror() */
- if (!FioCheckFileExists(c->filename)) error("NewGRF file is missing '%s'", c->filename);
+ if (!FioCheckFileExists(c->filename)) usererror("NewGRF file is missing '%s'", c->filename);
if (stage == GLS_LABELSCAN) InitNewGRFFile(c, _cur_spriteid);
LoadNewGRFFile(c, slot++, stage);