mirror of https://github.com/OpenTTD/OpenTTD
(svn r22566) -Codechange: Define and use OverrideManagerBase::GetGRFID function.
parent
281bed03f4
commit
9f55abf51a
|
@ -141,6 +141,16 @@ uint16 OverrideManagerBase::AddEntityID(byte grf_local_id, uint32 grfid, byte su
|
||||||
return invalid_ID;
|
return invalid_ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gives the GRFID of the file the entity belongs to.
|
||||||
|
* @param entity_id ID of the entity being queried.
|
||||||
|
* @return GRFID.
|
||||||
|
*/
|
||||||
|
uint16 OverrideManagerBase::GetGRFID(uint16 entity_id) const
|
||||||
|
{
|
||||||
|
return mapping_ID[entity_id].grfid;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gives the substitute of the entity, as specified by the grf file
|
* Gives the substitute of the entity, as specified by the grf file
|
||||||
* @param entity_id of the entity being queried
|
* @param entity_id of the entity being queried
|
||||||
|
|
|
@ -185,6 +185,7 @@ public:
|
||||||
void Add(uint8 local_id, uint32 grfid, uint entity_type);
|
void Add(uint8 local_id, uint32 grfid, uint entity_type);
|
||||||
virtual uint16 AddEntityID(byte grf_local_id, uint32 grfid, byte substitute_id);
|
virtual uint16 AddEntityID(byte grf_local_id, uint32 grfid, byte substitute_id);
|
||||||
|
|
||||||
|
uint16 GetGRFID(uint16 entity_id) const;
|
||||||
uint16 GetSubstituteID(uint16 entity_id) const;
|
uint16 GetSubstituteID(uint16 entity_id) const;
|
||||||
virtual uint16 GetID(uint8 grf_local_id, uint32 grfid) const;
|
virtual uint16 GetID(uint8 grf_local_id, uint32 grfid) const;
|
||||||
|
|
||||||
|
|
|
@ -344,7 +344,7 @@ static uint32 HouseGetVariable(const ResolverObject *object, byte variable, byte
|
||||||
if (house_id < NEW_HOUSE_OFFSET) return 0;
|
if (house_id < NEW_HOUSE_OFFSET) return 0;
|
||||||
/* Checking the grffile information via HouseSpec doesn't work
|
/* Checking the grffile information via HouseSpec doesn't work
|
||||||
* in case the newgrf was removed. */
|
* in case the newgrf was removed. */
|
||||||
return _house_mngr.mapping_ID[house_id].grfid;
|
return _house_mngr.GetGRFID(house_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue