summaryrefslogtreecommitdiff
path: root/src/road_cmd.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2008-01-25 15:47:58 +0000
committerfrosch <frosch@openttd.org>2008-01-25 15:47:58 +0000
commit6f6708e8448f891bc03c87c630a0c8f9cf47d332 (patch)
treef904e7af79be7c749721bcae930333e27ad88830 /src/road_cmd.cpp
parentd11aeb118c7a0b5f6c1900dfcdcfd97ea2333097 (diff)
downloadopenttd-6f6708e8448f891bc03c87c630a0c8f9cf47d332.tar.xz
(svn r11983) -Codechange: Add some helper functions for slopes and use them.
Diffstat (limited to 'src/road_cmd.cpp')
-rw-r--r--src/road_cmd.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp
index 060b61a24..15c920b94 100644
--- a/src/road_cmd.cpp
+++ b/src/road_cmd.cpp
@@ -376,7 +376,7 @@ static CommandCost CheckRoadSlope(Slope tileh, RoadBits* pieces, RoadBits existi
*pieces |= MirrorRoadBits(*pieces);
/* partly leveled up tile, only if there's no road on that tile */
- if ((existing == ROAD_NONE || existing == *pieces) && (tileh == SLOPE_W || tileh == SLOPE_S || tileh == SLOPE_E || tileh == SLOPE_N)) {
+ if ((existing == ROAD_NONE || existing == *pieces) && IsSlopeWithOneCornerRaised(tileh)) {
if (*pieces == ROAD_X || *pieces == ROAD_Y) return CommandCost(EXPENSES_CONSTRUCTION, _price.terraform);
}
return CMD_ERROR;