--- a/src/newgrf.cpp Sun Nov 04 22:21:46 2007 +0000
+++ b/src/newgrf.cpp Sun Nov 04 22:24:03 2007 +0000
@@ -5426,7 +5426,7 @@
_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_INITIALISED) return;
+ if (stage == GLS_ACTIVATION && !HASBIT(config->flags, GCF_RESERVED)) return;
}
if (file_index > LAST_GRF_SLOT) {
@@ -5560,8 +5560,9 @@
if (stage == GLS_LABELSCAN) InitNewGRFFile(c, _cur_spriteid);
LoadNewGRFFile(c, slot++, stage);
if (stage == GLS_RESERVE) {
- if (c->status == GCS_ACTIVATED) c->status = GCS_INITIALISED;
+ SETBIT(c->flags, GCF_RESERVED);
} else if (stage == GLS_ACTIVATION) {
+ CLRBIT(c->flags, GCF_RESERVED);
ClearTemporaryNewGRFData();
BuildCargoTranslationMap();
DEBUG(sprite, 2, "LoadNewGRF: Currently %i sprites are loaded", _cur_spriteid);
--- a/src/newgrf_config.h Sun Nov 04 22:21:46 2007 +0000
+++ b/src/newgrf_config.h Sun Nov 04 22:24:03 2007 +0000
@@ -15,6 +15,7 @@
GCF_COMPATIBLE,///< GRF file does not exactly match the requested GRF (different MD5SUM), but grfid matches)
GCF_COPY, ///< The data is copied from a grf in _all_grfs
GCF_INIT_ONLY, ///< GRF file is processed up to GLS_INIT
+ GCF_RESERVED, ///< GRF file passed GLS_RESERVE stage
};
enum GRFStatus {