summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-12-29 23:49:48 +0000
committerrubidium <rubidium@openttd.org>2007-12-29 23:49:48 +0000
commita3b19fd50ce456e3d3966719066737e7f6f5bcbf (patch)
treebda4fde219cde9e0fba15c082747a07c3c98fc3e /src
parent06d578d07e6c1d0e0fa5ec2848b223a179410ed3 (diff)
downloadopenttd-a3b19fd50ce456e3d3966719066737e7f6f5bcbf.tar.xz
(svn r11721) -Fix: do not disable NewGRFs for 'eternity' during games.
Diffstat (limited to 'src')
-rw-r--r--src/newgrf.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp
index 42bd6088c..431f7464a 100644
--- a/src/newgrf.cpp
+++ b/src/newgrf.cpp
@@ -5607,6 +5607,17 @@ void LoadNewGRF(uint load_index, uint file_index)
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. */