diff options
author | yexo <yexo@openttd.org> | 2010-09-13 13:27:29 +0000 |
---|---|---|
committer | yexo <yexo@openttd.org> | 2010-09-13 13:27:29 +0000 |
commit | 2d4c5ea66864e4b53d75decaa14ffafe643aa8ed (patch) | |
tree | eab99373a6254a1ef859828039905d8ebdb6fc51 /src | |
parent | e5a81fbbde4c0e61845250350013334b9ec2f40a (diff) | |
download | openttd-2d4c5ea66864e4b53d75decaa14ffafe643aa8ed.tar.xz |
(svn r20797) -Fix: disable houses without a size that are available according to their building flags
Diffstat (limited to 'src')
-rw-r--r-- | src/house.h | 3 | ||||
-rw-r--r-- | src/newgrf.cpp | 7 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/house.h b/src/house.h index f99d7df6d..e1ecce25b 100644 --- a/src/house.h +++ b/src/house.h @@ -80,7 +80,8 @@ enum HouseZones { ///< Bit Value Meaning HZ_TEMP = 0x1000, ///< 12 1000 can appear in temperate climate HZ_SUBARTC_BELOW = 0x2000, ///< 13 2000 can appear in sub-arctic climate below the snow line HZ_SUBTROPIC = 0x4000, ///< 14 4000 can appear in subtropical climate - HZ_TOYLND = 0x8000 ///< 15 8000 can appear in toyland climate + HZ_TOYLND = 0x8000, ///< 15 8000 can appear in toyland climate + HZ_CLIMALL = 0xF800, ///< Bitmask of all climate bits }; DECLARE_ENUM_AS_BIT_SET(HouseZones) diff --git a/src/newgrf.cpp b/src/newgrf.cpp index 04ece0938..b20b297a0 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -7318,6 +7318,13 @@ static bool IsHouseSpecValid(HouseSpec *hs, const HouseSpec *next1, const HouseS return false; } + /* Make sure that additional parts of multitile houses are not available. */ + if ((hs->building_flags & BUILDING_HAS_1_TILE) == 0 && (hs->building_availability & HZ_ZONALL) != 0 && (hs->building_availability & HZ_CLIMALL) != 0) { + hs->enabled = false; + if (filename != NULL) DEBUG(grf, 1, "FinaliseHouseArray: %s defines house %d without a size but marked it as available. Disabling house.", filename, hs->grf_prop.local_id); + return false; + } + return true; } |