summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/landscape.cpp4
-rw-r--r--src/saveload/afterload.cpp7
-rw-r--r--src/tile_map.h1
3 files changed, 12 insertions, 0 deletions
diff --git a/src/landscape.cpp b/src/landscape.cpp
index 2677014f7..25b41d130 100644
--- a/src/landscape.cpp
+++ b/src/landscape.cpp
@@ -831,6 +831,8 @@ static void CreateDesertOrRainForest()
for (TileIndex tile = 0; tile != MapSize(); ++tile) {
if ((tile % update_freq) == 0) IncreaseGeneratingWorldProgress(GWP_LANDSCAPE);
+ if (!IsValidTile(tile)) continue;
+
for (data = _make_desert_or_rainforest_data;
data != endof(_make_desert_or_rainforest_data); ++data) {
TileIndex t = AddTileIndexDiffCWrap(tile, *data);
@@ -849,6 +851,8 @@ static void CreateDesertOrRainForest()
for (TileIndex tile = 0; tile != MapSize(); ++tile) {
if ((tile % update_freq) == 0) IncreaseGeneratingWorldProgress(GWP_LANDSCAPE);
+ if (!IsValidTile(tile)) continue;
+
for (data = _make_desert_or_rainforest_data;
data != endof(_make_desert_or_rainforest_data); ++data) {
TileIndex t = AddTileIndexDiffCWrap(tile, *data);
diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp
index c8e2e5e73..4ff915742 100644
--- a/src/saveload/afterload.cpp
+++ b/src/saveload/afterload.cpp
@@ -2101,6 +2101,13 @@ bool AfterLoadGame()
}
}
+ if (CheckSavegameVersion(141)) {
+ for (TileIndex t = 0; t < map_size; t++) {
+ /* Reset tropic zone for VOID tiles, they shall not have any. */
+ if (IsTileType(t, MP_VOID)) SetTropicZone(t, TROPICZONE_NORMAL);
+ }
+ }
+
/* Road stops is 'only' updating some caches */
AfterLoadRoadStops();
AfterLoadLabelMaps();
diff --git a/src/tile_map.h b/src/tile_map.h
index fcbe2199c..393b89e01 100644
--- a/src/tile_map.h
+++ b/src/tile_map.h
@@ -186,6 +186,7 @@ static inline bool IsTileOwner(TileIndex tile, Owner owner)
static inline void SetTropicZone(TileIndex tile, TropicZone type)
{
assert(tile < MapSize());
+ assert(!IsTileType(tile, MP_VOID) || type == TROPICZONE_NORMAL);
SB(_m[tile].m6, 0, 2, type);
}