File diff r7804:430f640b5f9e → r7805:7b5af263f275
src/newgrf.cpp
Show inline comments
 
@@ -44,12 +44,13 @@
 
#include "table/build_industry.h"
 
#include "newgrf_commons.h"
 
#include "newgrf_townname.h"
 
#include "newgrf_industries.h"
 
#include "table/landscape_sprite.h"
 
#include "gfxinit.h"
 
#include "fios.h"
 

	
 
/* TTDPatch extended GRF format codec
 
 * (c) Petr Baudis 2004 (GPL'd)
 
 * Changes by Florian octo Forster are (c) by the OpenTTD development team.
 
 *
 
 * Contains portions of documentation by TTDPatch team.
 
@@ -5418,12 +5419,21 @@ void LoadNewGRFFile(GRFConfig *config, u
 
		_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 (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);
 
		config->error->severity = STR_NEWGRF_ERROR_MSG_FATAL;
 
		config->error->message  = STR_NEWGRF_ERROR_TOO_MANY_NEWGRFS_LOADED;
 
		return;
 
	}
 

	
 
	FioOpenFile(file_index, filename);
 
	_file_index = file_index; // XXX
 

	
 
	_cur_grfconfig = config;
 

	
 
	DEBUG(grf, 2, "LoadNewGRFFile: Reading NewGRF-file '%s'", filename);