summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2010-08-24 16:30:31 +0000
committeryexo <yexo@openttd.org>2010-08-24 16:30:31 +0000
commit0a644af019bdd3567707e6dfe470be674c26db57 (patch)
tree643e9c8422273b3f712f150bcfeeef547279fd94
parent9390bddbbdb1f2d7911db0a461827aa1f2a5d347 (diff)
downloadopenttd-0a644af019bdd3567707e6dfe470be674c26db57.tar.xz
(svn r20611) -Fix: disable newgrf houses that have a different size then their substitute type
-rw-r--r--src/newgrf.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp
index 7b2edda0e..ff881e539 100644
--- a/src/newgrf.cpp
+++ b/src/newgrf.cpp
@@ -7093,6 +7093,13 @@ static void FinaliseHouseArray()
continue;
}
+ /* Substitute type is also used for override, and having an override with a different size causes crashes. */
+ if ((hs->building_flags & BUILDING_HAS_1_TILE) != (HouseSpec::Get(hs->grf_prop.subst_id)->building_flags & BUILDING_HAS_1_TILE)) {
+ hs->enabled = false;
+ DEBUG(grf, 1, "FinaliseHouseArray: %s defines house %d with different house size then it's substitute type. Disabling house.", (*file)->filename, hs->grf_prop.local_id);
+ continue;
+ }
+
_house_mngr.SetEntitySpec(hs);
if (hs->min_year < min_year) min_year = hs->min_year;
}