summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-07-29 12:11:50 +0000
committerrubidium <rubidium@openttd.org>2007-07-29 12:11:50 +0000
commitb0f2653eb8042169172389f632078519b345d14e (patch)
tree97f673986c2299bbf5c1c74620e2ea6101f8cc0d /src
parentaeb992ce90797a1744d40fea11980eeee30daa9e (diff)
downloadopenttd-b0f2653eb8042169172389f632078519b345d14e.tar.xz
(svn r10718) -Fix (r10698): when having a road corner on a slope removing the road bit perpendicular on the slope made the foundation disappear.
Diffstat (limited to 'src')
-rw-r--r--src/road_cmd.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp
index 1ae9a6a97..f0ff25bf2 100644
--- a/src/road_cmd.cpp
+++ b/src/road_cmd.cpp
@@ -842,7 +842,14 @@ struct DrawRoadTileStruct {
Foundation GetRoadFoundation(Slope tileh, RoadBits bits)
{
if (!IsSteepSlope(tileh)) {
- if ((~_valid_tileh_slopes_road[0][tileh] & bits) == 0) return FOUNDATION_NONE;
+ if ((~_valid_tileh_slopes_road[0][tileh] & bits) == 0) {
+ /* As one can remove a single road piece when in a corner on a foundation as
+ * it is on a sloped piece of landscape, one creates a state that cannot be
+ * created directly, but the state itself is still perfectly drawable.
+ * However, as we do not want this to be build directly, we need to check
+ * for that situation in here. */
+ return (tileh != 0 && HAS_SINGLE_BIT(bits)) ? FOUNDATION_LEVELED : FOUNDATION_NONE;
+ }
if ((~_valid_tileh_slopes_road[1][tileh] & bits) == 0) return FOUNDATION_LEVELED;
}