diff options
author | peter1138 <peter1138@openttd.org> | 2007-01-03 11:33:54 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2007-01-03 11:33:54 +0000 |
commit | 969194629e44ce9e4678ec255655e64d806e560a (patch) | |
tree | 1979787aa46ec393869534ac5852bf28521c8406 /src/newgrf_config.c | |
parent | a972c406dd37ef90de5dc8cff0425a2f7fd514ea (diff) | |
download | openttd-969194629e44ce9e4678ec255655e64d806e560a.tar.xz |
(svn r7795) -Codechange: [NewGRF] When safety checking, allow an Action E that force activates the GRF. Unfortunately this requires knowing the GRF ID in advance (before the Action 8) so the static GRFs are now scanned twice on start up, once for the GRF ID, and then for the safety check. (This fix allows unifont.grf to be used.)
Diffstat (limited to 'src/newgrf_config.c')
-rw-r--r-- | src/newgrf_config.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/newgrf_config.c b/src/newgrf_config.c index a6ab2fae5..977cb139e 100644 --- a/src/newgrf_config.c +++ b/src/newgrf_config.c @@ -70,14 +70,19 @@ bool FillGRFDetails(GRFConfig *config, bool is_static) /* Find and load the Action 8 information */ /* 62 is the last file slot before sample.cat. * Should perhaps be some "don't care" value */ - LoadNewGRFFile(config, 62, is_static ? GLS_SAFETYSCAN : GLS_FILESCAN); - - /* GCF_UNSAFE is set if GLS_SAFETYSCAN finds unsafe actions */ - if (HASBIT(config->flags, GCF_UNSAFE)) return false; + LoadNewGRFFile(config, 62, GLS_FILESCAN); /* Skip if the grfid is 0 (not read) or 0xFFFFFFFF (ttdp system grf) */ if (config->grfid == 0 || config->grfid == 0xFFFFFFFF) return false; + if (is_static) { + /* Perform a 'safety scan' for static GRFs */ + LoadNewGRFFile(config, 62, GLS_SAFETYSCAN); + + /* GCF_UNSAFE is set if GLS_SAFETYSCAN finds unsafe actions */ + if (HASBIT(config->flags, GCF_UNSAFE)) return false; + } + return CalcGRFMD5Sum(config); } |