From 66543bde1d279c76d095e18bafe05c03de7be346 Mon Sep 17 00:00:00 2001 From: yexo Date: Sun, 13 Feb 2011 21:44:00 +0000 Subject: (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 --- src/newgrf.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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) { -- cgit v1.2.3-54-g00ecf