File diff r7830:80ef221c9406 → r7831:09718d610cd4
src/newgrf.cpp
Show inline comments
 
@@ -5423,13 +5423,13 @@ void LoadNewGRFFile(GRFConfig *config, u
 
	 * carried out.  All others are ignored, because they only need to be
 
	 * processed once at initialization.  */
 
	if (stage != GLS_FILESCAN && stage != GLS_SAFETYSCAN && stage != GLS_LABELSCAN) {
 
		_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) {
 
		DEBUG(grf, 0, "'%s' is not loaded as the maximum number of GRFs has been reached", filename);
 
		config->status = GCS_DISABLED;
 
		config->error  = CallocT<GRFError>(1);
 
@@ -5557,14 +5557,15 @@ void LoadNewGRF(uint load_index, uint fi
 
			/* @todo usererror() */
 
			if (!FioCheckFileExists(c->filename)) error("NewGRF file is missing '%s'", c->filename);
 

	
 
			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);
 
			}
 
		}
 
	}