summaryrefslogtreecommitdiff
path: root/src/newgrf_config.c
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2007-01-03 11:33:54 +0000
committerpeter1138 <peter1138@openttd.org>2007-01-03 11:33:54 +0000
commit8cb56a9af6cee1f3ea09c8cf2e815d2c127c3d5e (patch)
tree1979787aa46ec393869534ac5852bf28521c8406 /src/newgrf_config.c
parent789b76d36b21f23c8654cf5767880894b3dab68f (diff)
downloadopenttd-8cb56a9af6cee1f3ea09c8cf2e815d2c127c3d5e.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.c13
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);
}