summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2011-02-13 21:44:00 +0000
committeryexo <yexo@openttd.org>2011-02-13 21:44:00 +0000
commit66543bde1d279c76d095e18bafe05c03de7be346 (patch)
tree56a05e6ef85bb2e0f861a6618ef13537e1bde1a1 /src
parentb51c62f5af9aa09a8d91d04f298c8287e4a5e285 (diff)
downloadopenttd-66543bde1d279c76d095e18bafe05c03de7be346.tar.xz
(svn r22075) -Fix [FS#4501]: newgrfs with invalid multi-tile houses could cause a valid 1x1 house following it to be seen as multi-tile, causing crashes
Diffstat (limited to 'src')
-rw-r--r--src/newgrf.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp
index 267d47656..83170d2f9 100644
--- a/src/newgrf.cpp
+++ b/src/newgrf.cpp
@@ -7628,7 +7628,16 @@ static void FinaliseHouseArray()
/* We need to check all houses again to we are sure that multitile houses
* did get consecutive IDs and none of the parts are missing. */
- IsHouseSpecValid(hs, next1, next2, next3, NULL);
+ if (!IsHouseSpecValid(hs, next1, next2, next3, NULL)) {
+ /* GetHouseNorthPart checks 3 houses that are directly before
+ * it in the house pool. If any of those houses have multi-tile
+ * flags set it assumes it's part of a multitile house. Since
+ * we can have invalid houses in the pool marked as disabled, we
+ * don't want to have them influencing valid tiles. As such set
+ * building_flags to zero here to make sure any house following
+ * this one in the pool is properly handled as 1x1 house. */
+ hs->building_flags = 0;
+ }
}
if (min_year != 0) {