summaryrefslogtreecommitdiff
path: root/waypoint.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-04-23 13:48:16 +0000
committertron <tron@openttd.org>2006-04-23 13:48:16 +0000
commitdd180a1e1883336a1edc3b4d6eac440f06e3685b (patch)
tree3f0769bd955cefba7ab80063e64546c1874e0a62 /waypoint.c
parentfa213c686ee1d348d1eb167f2423261d8040205e (diff)
downloadopenttd-dd180a1e1883336a1edc3b4d6eac440f06e3685b.tar.xz
(svn r4541) Add a type for slopes and replace many magic numbers by the appropriate enums
Diffstat (limited to 'waypoint.c')
-rw-r--r--waypoint.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/waypoint.c b/waypoint.c
index 957076811..2de0bf0d5 100644
--- a/waypoint.c
+++ b/waypoint.c
@@ -174,7 +174,7 @@ void UpdateAllWaypointCustomGraphics(void)
int32 CmdBuildTrainWaypoint(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
{
Waypoint *wp;
- uint tileh;
+ Slope tileh;
Axis axis;
SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION);
@@ -196,8 +196,8 @@ int32 CmdBuildTrainWaypoint(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
if (!EnsureNoVehicle(tile)) return CMD_ERROR;
tileh = GetTileSlope(tile, NULL);
- if (tileh != 0) {
- if (!_patches.build_on_slopes || IsSteepTileh(tileh) || !(tileh & (0x3 << axis)) || !(tileh & ~(0x3 << axis)))
+ if (tileh != SLOPE_FLAT) {
+ if (!_patches.build_on_slopes || IsSteepSlope(tileh) || !(tileh & (0x3 << axis)) || !(tileh & ~(0x3 << axis)))
return_cmd_error(STR_0007_FLAT_LAND_REQUIRED);
}