@@ -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:
@@ -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);
}
/**
Status change: