diff options
author | frosch <frosch@openttd.org> | 2008-11-23 14:17:41 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2008-11-23 14:17:41 +0000 |
commit | 3d467cabe5ff086a76ecee1c9ae91da3f3caf35d (patch) | |
tree | f40e12e3b8552cbd2e88bf34163d9d6bd7504306 /src/openttd.cpp | |
parent | 2277a1ff9ccd2e5a5acca1e815f628f054c84491 (diff) | |
download | openttd-3d467cabe5ff086a76ecee1c9ae91da3f3caf35d.tar.xz |
(svn r14611) -Fix (r13437)[FS#2421]: Store the age of a house in the map array instead of the construction year.
Note: Savegames from r13437 to now are broken and have a age of 255 years for a lot houses.
Diffstat (limited to 'src/openttd.cpp')
-rw-r--r-- | src/openttd.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/openttd.cpp b/src/openttd.cpp index c79b68014..c4c39cf9a 100644 --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -2477,8 +2477,8 @@ bool AfterLoadGame() } if (CheckSavegameVersion(99)) { - /* Set newly introduced WaterClass of industry tiles */ for (TileIndex t = 0; t < map_size; t++) { + /* Set newly introduced WaterClass of industry tiles */ if (IsTileType(t, MP_STATION) && IsOilRig(t)) { SetWaterClassDependingOnSurroundings(t, true); } @@ -2489,6 +2489,11 @@ bool AfterLoadGame() SetWaterClass(t, WATER_CLASS_INVALID); } } + + /* Replace "house construction year" with "house age" */ + if (IsTileType(t, MP_HOUSE) && IsHouseCompleted(t)) { + _m[t].m5 = Clamp(_cur_year - (_m[t].m5 + ORIGINAL_BASE_YEAR), 0, 0xFF); + } } } |