changeset 8159:8debc9f52e23 draft

(svn r11721) -Fix: do not disable NewGRFs for 'eternity' during games.
author rubidium <rubidium@openttd.org>
date Sat, 29 Dec 2007 23:49:48 +0000
parents e2bea11667fd
children ba0cb80124fa
files src/newgrf.cpp
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/newgrf.cpp
+++ b/src/newgrf.cpp
@@ -5607,6 +5607,17 @@
 
 	ResetNewGRFData();
 
+	/*
+	 * Reset the status of all files, so we can 'retry' to load them.
+	 * This is needed when one for example rearranges the NewGRFs in-game
+	 * and a previously disabled NewGRF becomes useable. If it would not
+	 * be reset, the NewGRF would remain disabled even though it should
+	 * have been enabled.
+	 */
+	for (GRFConfig *c = _grfconfig; c != NULL; c = c->next) {
+		if (c->status != GCS_NOT_FOUND) c->status = GCS_UNKNOWN;
+	}
+
 	/* Load newgrf sprites
 	 * in each loading stage, (try to) open each file specified in the config
 	 * and load information from it. */