(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.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user