summaryrefslogtreecommitdiff
path: root/src/saveload
diff options
context:
space:
mode:
authorPeter Nelson <peter1138@openttd.org>2019-03-24 00:12:31 +0000
committerPeterN <peter@fuzzle.org>2019-03-24 15:16:54 +0000
commit76e77aefada54d1a0dbf7e4b7fb12a9c5f3cb838 (patch)
tree832032eeb13e8c8f2c05c736b1bb675adcf2d0ab /src/saveload
parent317f69c1520a3e60335c56d358686609d3decf86 (diff)
downloadopenttd-76e77aefada54d1a0dbf7e4b7fb12a9c5f3cb838.tar.xz
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.
Diffstat (limited to 'src/saveload')
-rw-r--r--src/saveload/afterload.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp
index 6f32c5506..f94063265 100644
--- a/src/saveload/afterload.cpp
+++ b/src/saveload/afterload.cpp
@@ -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();