changeset 15926:84334b1ff5da draft

(svn r20611) -Fix: disable newgrf houses that have a different size then their substitute type
author yexo <yexo@openttd.org>
date Tue, 24 Aug 2010 16:30:31 +0000
parents 197b55354472
children dd66c5a0e4de
files src/newgrf.cpp
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/newgrf.cpp
+++ b/src/newgrf.cpp
@@ -7093,6 +7093,13 @@
 				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;
 		}