From 05d29d8a3d46b202cef21a192f8ae974ff23f99e Mon Sep 17 00:00:00 2001 From: yexo Date: Tue, 16 Mar 2010 16:04:35 +0000 Subject: [PATCH] (svn r19435) -Fix: when loading a savegame created with a house newgrf without that newgrf available all houses became tall office blocks --- src/newgrf_commons.cpp | 2 +- src/newgrf_commons.h | 2 +- src/saveload/town_sl.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/newgrf_commons.cpp b/src/newgrf_commons.cpp index cf86834980..f95ad985cb 100644 --- a/src/newgrf_commons.cpp +++ b/src/newgrf_commons.cpp @@ -136,7 +136,7 @@ uint16 OverrideManagerBase::AddEntityID(byte grf_local_id, uint32 grfid, byte su * @param entity_id of the entity being queried * @return mapped id */ -uint16 OverrideManagerBase::GetSubstituteID(byte entity_id) +uint16 OverrideManagerBase::GetSubstituteID(uint16 entity_id) { return mapping_ID[entity_id].substitute_id; } diff --git a/src/newgrf_commons.h b/src/newgrf_commons.h index e531c824e1..a6b94e2e29 100644 --- a/src/newgrf_commons.h +++ b/src/newgrf_commons.h @@ -57,7 +57,7 @@ public: void Add(uint8 local_id, uint32 grfid, uint entity_type); virtual uint16 AddEntityID(byte grf_local_id, uint32 grfid, byte substitute_id); - uint16 GetSubstituteID(byte entity_id); + uint16 GetSubstituteID(uint16 entity_id); virtual uint16 GetID(uint8 grf_local_id, uint32 grfid); inline uint16 GetMaxMapping() { return max_new_entities; } diff --git a/src/saveload/town_sl.cpp b/src/saveload/town_sl.cpp index 47a7fb6c0d..d10a0c60e7 100644 --- a/src/saveload/town_sl.cpp +++ b/src/saveload/town_sl.cpp @@ -40,7 +40,7 @@ void UpdateHousesAndTowns() if (!IsTileType(t, MP_HOUSE)) continue; - house_id = GetHouseType(t); + house_id = GetCleanHouseType(t); if (!HouseSpec::Get(house_id)->enabled && house_id >= NEW_HOUSE_OFFSET) { /* The specs for this type of house are not available any more, so * replace it with the substitute original house type. */