summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-10-28 14:06:40 +0000
committertron <tron@openttd.org>2006-10-28 14:06:40 +0000
commit377b178c11011731eebbb9cb280434196b8ffec4 (patch)
tree35c642245922d4607581e33b9970091ed2cfc3fe
parent30ceecc1af8b4f03ac6da7170935a8f185adce27 (diff)
downloadopenttd-377b178c11011731eebbb9cb280434196b8ffec4.tar.xz
(svn r6993) -Regression (r5833): Rails/roads on steep slopes incorrectly show a foundation edge if the NE/NW adjacent tile is a steep tile
-rw-r--r--landscape.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/landscape.c b/landscape.c
index 4926c4e6d..93ce57616 100644
--- a/landscape.c
+++ b/landscape.c
@@ -183,8 +183,13 @@ static bool HasFoundationNW(TileIndex tile, Slope slope_here, uint z_here)
Slope slope = GetFoundationSlope(TILE_ADDXY(tile, 0, -1), &z);
return
- (z_here + (slope_here & SLOPE_N ? TILE_HEIGHT : 0) > z + (slope & SLOPE_E ? TILE_HEIGHT : 0)) ||
- (z_here + (slope_here & SLOPE_W ? TILE_HEIGHT : 0) > z + (slope & SLOPE_S ? TILE_HEIGHT : 0));
+ (
+ z_here + (slope_here & SLOPE_N ? TILE_HEIGHT : 0) + (slope_here == SLOPE_STEEP_N ? TILE_HEIGHT : 0) >
+ z + (slope & SLOPE_E ? TILE_HEIGHT : 0) + (slope == SLOPE_STEEP_E ? TILE_HEIGHT : 0)
+ ) || (
+ z_here + (slope_here & SLOPE_W ? TILE_HEIGHT : 0) + (slope_here == SLOPE_STEEP_W ? TILE_HEIGHT : 0) >
+ z + (slope & SLOPE_S ? TILE_HEIGHT : 0) + (slope == SLOPE_STEEP_S ? TILE_HEIGHT : 0)
+ );
}
@@ -194,8 +199,13 @@ static bool HasFoundationNE(TileIndex tile, Slope slope_here, uint z_here)
Slope slope = GetFoundationSlope(TILE_ADDXY(tile, -1, 0), &z);
return
- (z_here + (slope_here & SLOPE_N ? TILE_HEIGHT : 0) > z + (slope & SLOPE_W ? TILE_HEIGHT : 0)) ||
- (z_here + (slope_here & SLOPE_E ? TILE_HEIGHT : 0) > z + (slope & SLOPE_S ? TILE_HEIGHT : 0));
+ (
+ z_here + (slope_here & SLOPE_N ? TILE_HEIGHT : 0) + (slope_here == SLOPE_STEEP_N ? TILE_HEIGHT : 0) >
+ z + (slope & SLOPE_W ? TILE_HEIGHT : 0) + (slope == SLOPE_STEEP_W ? TILE_HEIGHT : 0)
+ ) || (
+ z_here + (slope_here & SLOPE_E ? TILE_HEIGHT : 0) + (slope_here == SLOPE_STEEP_E ? TILE_HEIGHT : 0) >
+ z + (slope & SLOPE_S ? TILE_HEIGHT : 0) + (slope == SLOPE_STEEP_S ? TILE_HEIGHT : 0)
+ );
}