diff options
author | zuu <zuu@openttd.org> | 2013-10-12 22:07:58 +0000 |
---|---|---|
committer | zuu <zuu@openttd.org> | 2013-10-12 22:07:58 +0000 |
commit | dfb566331390a87f01d048f57ed6d51b2f329d65 (patch) | |
tree | 76bcf6959e2acb63051f9f74a80b8154b95bc824 /src/saveload | |
parent | b35b8aa5bb38f9e47ca04ccd9302dd82546de0cd (diff) | |
download | openttd-dfb566331390a87f01d048f57ed6d51b2f329d65.tar.xz |
(svn r25849) -Codechange: Introduce IsTileFlat to not compute full slope information for situations when we only want to know if a tile is flat or not (cirdan, LordAro)
Diffstat (limited to 'src/saveload')
-rw-r--r-- | src/saveload/afterload.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp index 96b568b82..67b2f8975 100644 --- a/src/saveload/afterload.cpp +++ b/src/saveload/afterload.cpp @@ -74,7 +74,7 @@ void SetWaterClassDependingOnSurroundings(TileIndex t, bool include_invalid_wate { /* If the slope is not flat, we always assume 'land' (if allowed). Also for one-corner-raised-shores. * Note: Wrt. autosloping under industry tiles this is the most fool-proof behaviour. */ - if (GetTileSlope(t) != SLOPE_FLAT) { + if (!IsTileFlat(t)) { if (include_invalid_water_class) { SetWaterClass(t, WATER_CLASS_INVALID); return; @@ -1106,7 +1106,7 @@ bool AfterLoadGame() if (GB(_m[t].m5, 3, 2) == 0) { MakeClear(t, CLEAR_GRASS, 3); } else { - if (GetTileSlope(t) != SLOPE_FLAT) { + if (!IsTileFlat(t)) { MakeShore(t); } else { if (GetTileOwner(t) == OWNER_WATER) { @@ -1712,7 +1712,7 @@ bool AfterLoadGame() * on its neighbouring tiles. Done after river and canal updates to * ensure neighbours are correct. */ for (TileIndex t = 0; t < map_size; t++) { - if (GetTileSlope(t) != SLOPE_FLAT) continue; + if (!IsTileFlat(t)) continue; if (IsTileType(t, MP_WATER) && IsLock(t)) SetWaterClassDependingOnSurroundings(t, false); if (IsTileType(t, MP_STATION) && (IsDock(t) || IsBuoy(t))) SetWaterClassDependingOnSurroundings(t, false); @@ -2390,7 +2390,7 @@ bool AfterLoadGame() if (IsSavegameVersionBefore(149)) { for (TileIndex t = 0; t < map_size; t++) { if (!IsTileType(t, MP_STATION)) continue; - if (!IsBuoy(t) && !IsOilRig(t) && !(IsDock(t) && GetTileSlope(t) == SLOPE_FLAT)) { + if (!IsBuoy(t) && !IsOilRig(t) && !(IsDock(t) && IsTileFlat(t))) { SetWaterClass(t, WATER_CLASS_INVALID); } } |