Changeset - r25810:eaed796ad8c9
[Not reviewed]
master
0 1 0
rubidium42 - 3 years ago 2021-07-11 09:23:47
rubidium42@users.noreply.github.com
Remove: arbitrary limit on number of statically loaded NewGRFs (#9431)
1 file changed with 0 insertions and 9 deletions:
0 comments (0 inline, 0 general)
src/newgrf.cpp
Show inline comments
 
@@ -77,13 +77,12 @@ byte _misc_grf_features = 0;
 
static uint32 _ttdpatch_flags[8];
 

	
 
/** Indicates which are the newgrf features currently loaded ingame */
 
GRFLoadedFeatures _loaded_newgrf_features;
 

	
 
static const uint MAX_SPRITEGROUP = UINT8_MAX; ///< Maximum GRF-local ID for a spritegroup.
 
static const uint MAX_GRF_COUNT = 128; ///< Maximum number of NewGRF files that could be loaded.
 

	
 
/** Temporary data during loading of GRFs */
 
struct GrfProcessingState {
 
private:
 
	/** Definition of a single Action1 spriteset */
 
	struct SpriteSet {
 
@@ -9851,20 +9850,12 @@ void LoadNewGRF(uint load_index, uint nu
 
					c->error  = new GRFError(STR_NEWGRF_ERROR_MSG_FATAL, STR_NEWGRF_ERROR_TOO_MANY_NEWGRFS_LOADED);
 
					continue;
 
				}
 
				num_non_static++;
 
			}
 

	
 
			if (num_grfs >= MAX_GRF_COUNT) {
 
				Debug(grf, 0, "'{}' is not loaded as the maximum number of file slots has been reached", c->filename);
 
				c->status = GCS_DISABLED;
 
				c->error  = new GRFError(STR_NEWGRF_ERROR_MSG_FATAL, STR_NEWGRF_ERROR_TOO_MANY_NEWGRFS_LOADED);
 
				continue;
 
			}
 
			num_grfs++;
 

	
 
			LoadNewGRFFile(c, stage, subdir, false);
 
			if (stage == GLS_RESERVE) {
 
				SetBit(c->flags, GCF_RESERVED);
 
			} else if (stage == GLS_ACTIVATION) {
 
				ClrBit(c->flags, GCF_RESERVED);
 
				assert(GetFileByGRFID(c->ident.grfid) == _cur.grffile);
0 comments (0 inline, 0 general)