diff options
author | tron <tron@openttd.org> | 2006-04-23 13:48:16 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2006-04-23 13:48:16 +0000 |
commit | 0347fb2ab67e942826523424c35ede66d27339fe (patch) | |
tree | 3f0769bd955cefba7ab80063e64546c1874e0a62 /waypoint.c | |
parent | b5ce99c52d1ce36f56431652f7fcc67eb9d5bf6d (diff) | |
download | openttd-0347fb2ab67e942826523424c35ede66d27339fe.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.c | 6 |
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); } |