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
commitee256e770afb5f04a6a10f3b2045dd426d3167ff (patch)
tree62bef57de81c1ddcc691d5de5e8db395615bdacc /src/newgrf.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/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);