summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2007-06-07 18:13:31 +0000
committerpeter1138 <peter1138@openttd.org>2007-06-07 18:13:31 +0000
commitc1df3a8aa63645f31fe99d506f0ceb45e3085326 (patch)
treeb89864d6a8c1098e235a93930dca89b4df45510e
parent8a74b2ebe179500f1e95647cdf4a2e740ea1df23 (diff)
downloadopenttd-c1df3a8aa63645f31fe99d506f0ceb45e3085326.tar.xz
(svn r10059) -Fix (r10045): Pretend GRF is still in initialisation state when leaving reservation stage. This fixes action 7/9 tests for grfs that will be active.
-rw-r--r--src/newgrf.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp
index a646b686d..f91f947d6 100644
--- a/src/newgrf.cpp
+++ b/src/newgrf.cpp
@@ -4830,7 +4830,7 @@ void LoadNewGRFFile(GRFConfig *config, uint file_index, GrfLoadingStage stage)
_cur_grffile = GetFileByFilename(filename);
if (_cur_grffile == NULL) error("File '%s' lost in cache.\n", filename);
if (stage == GLS_RESERVE && config->status != GCS_INITIALISED) return;
- if (stage == GLS_ACTIVATION && config->status != GCS_ACTIVATED) return;
+ if (stage == GLS_ACTIVATION && config->status != GCS_INITIALISED) return;
}
FioOpenFile(file_index, filename);
@@ -4945,7 +4945,9 @@ void LoadNewGRF(uint load_index, uint file_index)
if (stage == GLS_LABELSCAN) InitNewGRFFile(c, _cur_spriteid);
LoadNewGRFFile(c, slot++, stage);
- if (stage == GLS_ACTIVATION) {
+ if (stage == GLS_RESERVE) {
+ if (c->status == GCS_ACTIVATED) c->status = GCS_INITIALISED;
+ } else if (stage == GLS_ACTIVATION) {
ClearTemporaryNewGRFData();
BuildCargoTranslationMap();
DEBUG(sprite, 2, "LoadNewGRF: Currently %i sprites are loaded", _cur_spriteid);