summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2010-08-09 07:19:44 +0000
committerfrosch <frosch@openttd.org>2010-08-09 07:19:44 +0000
commitc2b1c624dd0d7909c69ddfba1eb2cf611b22cd25 (patch)
tree153f366717e27acd7506a3a23674f62ec8862e16
parent48c5091a7c39739e48d06ec365af4f7c713dd25a (diff)
downloadopenttd-c2b1c624dd0d7909c69ddfba1eb2cf611b22cd25.tar.xz
(svn r20421) -Change [FS#3947]: Make snowyness of bridgehead depend on the tileheight at the entry edge.
-rw-r--r--src/tunnelbridge_cmd.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/tunnelbridge_cmd.cpp b/src/tunnelbridge_cmd.cpp
index 0d064793d..adb399af8 100644
--- a/src/tunnelbridge_cmd.cpp
+++ b/src/tunnelbridge_cmd.cpp
@@ -1396,12 +1396,17 @@ static void TileLoop_TunnelBridge(TileIndex tile)
{
bool snow_or_desert = HasTunnelBridgeSnowOrDesert(tile);
switch (_settings_game.game_creation.landscape) {
- case LT_ARCTIC:
- if (snow_or_desert != (GetTileZ(tile) > GetSnowLine())) {
+ case LT_ARCTIC: {
+ /* As long as we do not have a snow density, we want to use the density
+ * from the entry endge. For tunnels this is the lowest point for bridges the highest point.
+ * (Independent of foundations) */
+ uint z = IsBridge(tile) ? GetTileMaxZ(tile) : GetTileZ(tile);
+ if (snow_or_desert != (z > GetSnowLine())) {
SetTunnelBridgeSnowOrDesert(tile, !snow_or_desert);
MarkTileDirtyByTile(tile);
}
break;
+ }
case LT_TROPIC:
if (GetTropicZone(tile) == TROPICZONE_DESERT && !snow_or_desert) {