(svn r12333) -Fix: Switch grfstatus from 'activated' back to 'will-be-active' between reservation- and activation-stage.
authorfrosch
Tue, 04 Mar 2008 10:41:16 +0000
changeset 9164 04e2cc7a00e6
parent 9163 79101c0c3bc9
child 9165 765c4f60311c
(svn r12333) -Fix: Switch grfstatus from 'activated' back to 'will-be-active' between reservation- and activation-stage.
This fixes action7/9 conditions 0x06 to 0x0A to return the same in those two stages.
src/newgrf.cpp
--- a/src/newgrf.cpp	Mon Mar 03 21:42:37 2008 +0000
+++ b/src/newgrf.cpp	Tue Mar 04 10:41:16 2008 +0000
@@ -5853,6 +5853,12 @@
 	 * in each loading stage, (try to) open each file specified in the config
 	 * and load information from it. */
 	for (GrfLoadingStage stage = GLS_LABELSCAN; stage <= GLS_ACTIVATION; stage++) {
+		/* Set activated grfs back to will-be-activated between reservation- and activation-stage.
+		 * This ensures that action7/9 conditions 0x06 - 0x0A work correctly. */
+		for (GRFConfig *c = _grfconfig; c != NULL; c = c->next) {
+			if (c->status == GCS_ACTIVATED) c->status = GCS_INITIALISED;
+		}
+
 		uint slot = file_index;
 
 		_cur_stage = stage;