(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().
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user