summaryrefslogtreecommitdiff
path: root/src/newgrf.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-06-18 09:47:06 +0000
committerrubidium <rubidium@openttd.org>2009-06-18 09:47:06 +0000
commit98b4f1fce2714f25c4dc78d258b97e4c05d9d2f6 (patch)
tree81a25e7f8ea2cb196f6d5236e9a01e45fd3a42f2 /src/newgrf.cpp
parentb88443f035077990ccdb7966e08af69f9654fe58 (diff)
downloadopenttd-98b4f1fce2714f25c4dc78d258b97e4c05d9d2f6.tar.xz
(svn r16590) -Fix [FS#2967]: don't crash when tars/newgrfs are removed, just tell the file could be opened/found.
Diffstat (limited to 'src/newgrf.cpp')
-rw-r--r--src/newgrf.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp
index c226d295e..1426208e7 100644
--- a/src/newgrf.cpp
+++ b/src/newgrf.cpp
@@ -6212,8 +6212,11 @@ void LoadNewGRF(uint load_index, uint file_index)
if (c->status == GCS_DISABLED || c->status == GCS_NOT_FOUND) continue;
if (stage > GLS_INIT && HasBit(c->flags, GCF_INIT_ONLY)) continue;
- /* @todo usererror() */
- if (!FioCheckFileExists(c->filename)) usererror("NewGRF file is missing '%s'", c->filename);
+ if (!FioCheckFileExists(c->filename)) {
+ DEBUG(grf, 0, "NewGRF file is missing '%s'; disabling", c->filename);
+ c->status = GCS_NOT_FOUND;
+ continue;
+ }
if (stage == GLS_LABELSCAN) InitNewGRFFile(c, _cur_spriteid);
LoadNewGRFFile(c, slot++, stage);