diff options
author | frosch <frosch@openttd.org> | 2010-05-08 14:43:59 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2010-05-08 14:43:59 +0000 |
commit | 5b77a63ecfabe3537e10e681fac765fc5c46be10 (patch) | |
tree | 427fdfabeabbbc34074102dcc4a3d10e86946edb | |
parent | 173b56b895eb929991d9c83233a2ad95e6b3f82e (diff) | |
download | openttd-5b77a63ecfabe3537e10e681fac765fc5c46be10.tar.xz |
(svn r19769) -Fix [FS#3820]: MV_VOID tiles shall have no tropic zone.
-rw-r--r-- | src/landscape.cpp | 4 | ||||
-rw-r--r-- | src/saveload/afterload.cpp | 7 | ||||
-rw-r--r-- | src/tile_map.h | 1 |
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); } |