Changeset - r25408:c8d95f8f5e62
[Not reviewed]
master
0 2 0
PeterN - 3 years ago 2021-05-08 10:36:39
peter1138@openttd.org
Codechange: Don't save unused NewGRF override mappings. (#9202)
2 files changed with 2 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/newgrf_commons.h
Show inline comments
 
@@ -218,6 +218,7 @@ public:
 

	
 
	inline uint16 GetMaxMapping() const { return max_new_entities; }
 
	inline uint16 GetMaxOffset() const { return max_offset; }
 
	inline bool IsValidID(uint16 entity_id) const { return entity_overrides[entity_id] != invalid_ID; }
 
};
 

	
 

	
src/saveload/newgrf_sl.cpp
Show inline comments
 
@@ -30,6 +30,7 @@ static const SaveLoad _newgrf_mapping_de
 
void Save_NewGRFMapping(const OverrideManagerBase &mapping)
 
{
 
	for (uint i = 0; i < mapping.GetMaxMapping(); i++) {
 
		if (!mapping.IsValidID(i)) continue;
 
		SlSetArrayIndex(i);
 
		SlObject(&mapping.mapping_ID[i], _newgrf_mapping_desc);
 
	}
0 comments (0 inline, 0 general)