summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorplanetmaker <planetmaker@openttd.org>2011-04-07 22:27:54 +0000
committerplanetmaker <planetmaker@openttd.org>2011-04-07 22:27:54 +0000
commit87d07f19e833e377c6dc1b84acd651d804dfe90b (patch)
tree3ae67ce9c8552040fb02fe9fe7976d59578e9ae8 /src
parentb5e132924ef0993af82ed818eeed88534d4445b0 (diff)
downloadopenttd-87d07f19e833e377c6dc1b84acd651d804dfe90b.tar.xz
(svn r22299) -Fix [FS#4581]: Check the availability year of all houses, not just the NewGRF houses, when making sure that at least one is available onwards from year 0
Diffstat (limited to 'src')
-rw-r--r--src/newgrf.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp
index c96ff3347..cecec6d55 100644
--- a/src/newgrf.cpp
+++ b/src/newgrf.cpp
@@ -7613,8 +7613,6 @@ static void FinaliseHouseArray()
* On the other hand, why 1930? Just 'fix' the houses with the lowest
* minimum introduction date to 0.
*/
- Year min_year = MAX_YEAR;
-
const GRFFile * const *end = _grf_files.End();
for (GRFFile **file = _grf_files.Begin(); file != end; file++) {
HouseSpec **&housespec = (*file)->housespec;
@@ -7632,10 +7630,11 @@ static void FinaliseHouseArray()
if (!IsHouseSpecValid(hs, next1, next2, next3, (*file)->filename)) continue;
_house_mngr.SetEntitySpec(hs);
- if (hs->min_year < min_year) min_year = hs->min_year;
}
}
+ Year min_year = MAX_YEAR;
+
for (int i = 0; i < HOUSE_MAX; i++) {
HouseSpec *hs = HouseSpec::Get(i);
const HouseSpec *next1 = (i + 1 < HOUSE_MAX ? HouseSpec::Get(i + 1) : NULL);
@@ -7653,6 +7652,7 @@ static void FinaliseHouseArray()
* 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 = TILE_NO_FLAG;
+ if (hs->min_year < min_year) min_year = hs->min_year;
}
}