mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r10968) -Codechange: Remove a tileloop performed in the AfterLoadCountBuildings function and use the main loop of CheckhouseIDs instead
This commit is contained in:
parent
da8d778622
commit
a079834cfc
|
@ -33,6 +33,8 @@ HouseOverrideManager _house_mngr(NEW_HOUSE_OFFSET, HOUSE_MAX, INVALID_HOUSE_ID);
|
||||||
|
|
||||||
void CheckHouseIDs()
|
void CheckHouseIDs()
|
||||||
{
|
{
|
||||||
|
InitializeBuildingCounts();
|
||||||
|
|
||||||
for (TileIndex t = 0; t < MapSize(); t++) {
|
for (TileIndex t = 0; t < MapSize(); t++) {
|
||||||
HouseID house_id;
|
HouseID house_id;
|
||||||
|
|
||||||
|
@ -42,13 +44,11 @@ void CheckHouseIDs()
|
||||||
if (!GetHouseSpecs(house_id)->enabled && house_id >= NEW_HOUSE_OFFSET) {
|
if (!GetHouseSpecs(house_id)->enabled && house_id >= NEW_HOUSE_OFFSET) {
|
||||||
/* The specs for this type of house are not available any more, so
|
/* The specs for this type of house are not available any more, so
|
||||||
* replace it with the substitute original house type. */
|
* replace it with the substitute original house type. */
|
||||||
SetHouseType(t, _house_mngr.GetSubstituteID(house_id));
|
house_id = _house_mngr.GetSubstituteID(house_id);
|
||||||
|
SetHouseType(t, house_id);
|
||||||
}
|
}
|
||||||
|
IncreaseBuildingCount(GetTownByTile(t), house_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
InitializeBuildingCounts();
|
|
||||||
AfterLoadCountBuildings();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
HouseClassID AllocateHouseClassID(byte grf_class_id, uint32 grfid)
|
HouseClassID AllocateHouseClassID(byte grf_class_id, uint32 grfid)
|
||||||
|
|
Loading…
Reference in New Issue