summaryrefslogtreecommitdiff
path: root/rail_cmd.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-07-22 08:59:52 +0000
committertron <tron@openttd.org>2006-07-22 08:59:52 +0000
commit7ec704564a35940442d5ad52b39c850465685f31 (patch)
tree3cd7af50d593f93b4699b58b3293d63c0a9c7eef /rail_cmd.c
parent475f2767691da03e22cdcd6eb7bfd305c093166c (diff)
downloadopenttd-7ec704564a35940442d5ad52b39c850465685f31.tar.xz
(svn r5582) Add and use AxisToTrack{Bits,}()
Diffstat (limited to 'rail_cmd.c')
-rw-r--r--rail_cmd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/rail_cmd.c b/rail_cmd.c
index f5805dc9d..8dc73c063 100644
--- a/rail_cmd.c
+++ b/rail_cmd.c
@@ -234,7 +234,7 @@ int32 CmdBuildSingleRail(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
case MP_TUNNELBRIDGE:
if (!IsBridge(tile) ||
!IsBridgeMiddle(tile) ||
- (GetBridgeAxis(tile) == AXIS_X ? TRACK_BIT_Y : TRACK_BIT_X) != trackbit) {
+ AxisToTrackBits(OtherAxis(GetBridgeAxis(tile))) != trackbit) {
// Get detailed error message
return DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
}
@@ -1918,7 +1918,7 @@ static uint32 GetTileTrackStatus_Track(TileIndex tile, TransportType mode)
return ret;
} else {
if (GetRailTileSubtype(tile) == RAIL_SUBTYPE_DEPOT) {
- return (DiagDirToAxis(GetRailDepotDirection(tile)) == AXIS_X ? TRACK_BIT_X : TRACK_BIT_Y) * 0x101;
+ return AxisToTrackBits(DiagDirToAxis(GetRailDepotDirection(tile))) * 0x101;
} else {
return GetRailWaypointBits(tile) * 0x101;
}