(svn r8831) -Feature: If an action 7/9 leads to skipping the rest of the file, disable the
authormaedhros
Wed, 21 Feb 2007 17:54:30 +0000
changeset 6096 aafc68ecee06
parent 6095 d02d52f58ba6
child 6097 3dfcba0852d7
(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.
src/newgrf.cpp
--- a/src/newgrf.cpp	Wed Feb 21 17:20:44 2007 +0000
+++ b/src/newgrf.cpp	Wed Feb 21 17:54:30 2007 +0000
@@ -2535,6 +2535,9 @@
 		 * 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 @@
 		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