summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormaedhros <maedhros@openttd.org>2007-02-21 17:54:30 +0000
committermaedhros <maedhros@openttd.org>2007-02-21 17:54:30 +0000
commit7734c3d295ced54277e1fa886bae23520e788939 (patch)
tree246ad32c4df4407431f306684b70ffa523d662c0
parent95ad438f681c78d17637cd9d94a2a371553f6bd1 (diff)
downloadopenttd-7734c3d295ced54277e1fa886bae23520e788939.tar.xz
(svn r8831) -Feature: If an action 7/9 leads to skipping the rest of the file, disable the
newgrf if an action 8 hasn't been encountered yet.
-rw-r--r--src/newgrf.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp
index ae9429fb0..1c0aed0e9 100644
--- a/src/newgrf.cpp
+++ b/src/newgrf.cpp
@@ -2535,6 +2535,9 @@ static void SkipIf(byte *buf, int len)
* we use -1 to indicate that all further
* sprites should be skipped. */
_skip_sprites = -1;
+
+ /* If an action 8 hasn't been encountered yet, disable the grf. */
+ if (!HASBIT(_cur_grfconfig->flags, GCF_ACTIVATED)) SETBIT(_cur_grfconfig->flags, GCF_DISABLED);
}
}
@@ -3768,6 +3771,8 @@ void LoadNewGRFFile(GRFConfig *config, uint file_index, GrfLoadingStage stage)
if (stage == GLS_ACTIVATION && !HASBIT(config->flags, GCF_ACTIVATED)) return;
}
+ if (stage == GLS_ACTIVATION) CLRBIT(config->flags, GCF_ACTIVATED);
+
FioOpenFile(file_index, filename);
_file_index = file_index; // XXX