diff options
author | peter1138 <peter1138@openttd.org> | 2009-01-10 19:30:40 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2009-01-10 19:30:40 +0000 |
commit | 94e3f9dbac3c312e344c7d6b07878b5aee56ca52 (patch) | |
tree | 8436866fc391f16108270d7e668fcaf90304adc1 /src/newgrf.cpp | |
parent | bf744ec651bc6601f63116528824fd1da97bf8a7 (diff) | |
download | openttd-94e3f9dbac3c312e344c7d6b07878b5aee56ca52.tar.xz |
(svn r14979) -Fix: Disable a NewGRF from loading if it contains multiple Action 8s
Diffstat (limited to 'src/newgrf.cpp')
-rw-r--r-- | src/newgrf.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp index 19ff34803..e30e670ab 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -4140,6 +4140,16 @@ static void GRFInfo(byte *buf, size_t len) uint32 grfid = grf_load_dword(&buf); const char *name = grf_load_string(&buf, len - 6); + if (_cur_stage < GLS_RESERVE && _cur_grfconfig->status != GCS_UNKNOWN) { + _cur_grfconfig->status = GCS_DISABLED; + _cur_grfconfig->error = CallocT<GRFError>(1); + _cur_grfconfig->error->severity = STR_NEWGRF_ERROR_MSG_FATAL; + _cur_grfconfig->error->message = STR_NEWGRF_ERROR_MULTIPLE_ACTION_8; + + _skip_sprites = -1; + return; + } + _cur_grffile->grfid = grfid; _cur_grffile->grf_version = version; _cur_grfconfig->status = _cur_stage < GLS_RESERVE ? GCS_INITIALISED : GCS_ACTIVATED; |