summaryrefslogtreecommitdiff
path: root/src/newgrf.cpp
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2008-08-29 20:03:51 +0000
committerpeter1138 <peter1138@openttd.org>2008-08-29 20:03:51 +0000
commit50d230a52f9827f43e58c61e2cafd880ceb29d19 (patch)
tree1b1160fb4b1b59096fe19802c7ea1a6102af0f4a /src/newgrf.cpp
parentab46663eed691f49aa45c0165f944ff057c508bd (diff)
downloadopenttd-50d230a52f9827f43e58c61e2cafd880ceb29d19.tar.xz
(svn r14184) -Codechange: [NewGRF] Since our NewGRF handling is better than it used to be, disable a NewGRF if unexpected sprites are reached.
Diffstat (limited to 'src/newgrf.cpp')
-rw-r--r--src/newgrf.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp
index 2fc15c06a..35c604bb6 100644
--- a/src/newgrf.cpp
+++ b/src/newgrf.cpp
@@ -5918,7 +5918,14 @@ void LoadNewGRFFile(GRFConfig *config, uint file_index, GrfLoadingStage stage)
FioSkipBytes(num);
}
} else {
- if (_skip_sprites == 0) grfmsg(7, "LoadNewGRFFile: Skipping unexpected sprite");
+ if (_skip_sprites == 0) {
+ grfmsg(0, "LoadNewGRFFile: Unexpected sprite, disabling");
+ config->status = GCS_DISABLED;
+ config->error = CallocT<GRFError>(1);
+ config->error->severity = STR_NEWGRF_ERROR_MSG_FATAL;
+ config->error->message = STR_NEWGRF_ERROR_UNEXPECTED_SPRITE;
+ break;
+ }
FioSkipBytes(7);
num -= 8;