Fix #7400: Water class for tree tiles was not converted for old saves preventing industry creation.

As the information is always available from the tree ground type, unconditionally
update the map array for tree tiles.
This commit is contained in:
Peter Nelson
2019-03-24 00:12:31 +00:00
committed by PeterN
parent 317f69c152
commit 76e77aefad
2 changed files with 8 additions and 0 deletions

View File

@@ -3111,6 +3111,13 @@ bool AfterLoadGame()
FOR_ALL_INDUSTRIES(ind) if (ind->neutral_station != NULL) ind->neutral_station->industry = ind;
}
{
/* Update water class for trees for all current savegame versions. */
for (TileIndex t = 0; t < map_size; t++) {
if (IsTileType(t, MP_TREES)) SetWaterClass(t, GetTreeGround(t) == TREE_GROUND_SHORE ? WATER_CLASS_SEA : WATER_CLASS_INVALID);
}
}
/* Compute station catchment areas. This is needed here in case UpdateStationAcceptance is called below. */
Station::RecomputeCatchmentForAll();