From c1df3a8aa63645f31fe99d506f0ceb45e3085326 Mon Sep 17 00:00:00 2001 From: peter1138 Date: Thu, 7 Jun 2007 18:13:31 +0000 Subject: (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. --- src/newgrf.cpp | 6 ++++-- 1 file 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); -- cgit v1.2.3-54-g00ecf