Changeset - r25438:91ac2a71fe27
[Not reviewed]
master
0 2 0
PeterN - 3 years ago 2021-05-12 07:11:14
peter1138@openttd.org
Fix #9202: Invalid test for unset NewGRF override mapping. (#9226)
2 files changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/newgrf_commons.h
Show inline comments
 
@@ -215,13 +215,12 @@ public:
 
	uint32 GetGRFID(uint16 entity_id) const;
 
	uint16 GetSubstituteID(uint16 entity_id) const;
 
	virtual uint16 GetID(uint8 grf_local_id, uint32 grfid) const;
 

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

	
 

	
 
struct HouseSpec;
 
class HouseOverrideManager : public OverrideManagerBase {
 
public:
src/saveload/newgrf_sl.cpp
Show inline comments
 
@@ -27,13 +27,14 @@ static const SaveLoad _newgrf_mapping_de
 
 * Save a GRF ID + local id -> OpenTTD's id mapping.
 
 * @param mapping The mapping to save.
 
 */
 
void Save_NewGRFMapping(const OverrideManagerBase &mapping)
 
{
 
	for (uint i = 0; i < mapping.GetMaxMapping(); i++) {
 
		if (!mapping.IsValidID(i)) continue;
 
		if (mapping.mapping_ID[i].grfid == 0 &&
 
		    mapping.mapping_ID[i].entity_id == 0) continue;
 
		SlSetArrayIndex(i);
 
		SlObject(&mapping.mapping_ID[i], _newgrf_mapping_desc);
 
	}
 
}
 

	
 
/**
0 comments (0 inline, 0 general)