diff options
author | frosch <frosch@openttd.org> | 2008-02-20 17:49:50 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2008-02-20 17:49:50 +0000 |
commit | 7f3d56041b97972b67e5788dafafc0950b29c872 (patch) | |
tree | d325400c42801ac23226ccaf0d71008e4e3598ec /src/pathfind.cpp | |
parent | 86eec55b8ad268a117be3a3587ec9e5b834cdc0c (diff) | |
download | openttd-7f3d56041b97972b67e5788dafafc0950b29c872.tar.xz |
(svn r12199) -Codechange: Remove magic around the results of GetTileTrackStatus().
Diffstat (limited to 'src/pathfind.cpp')
-rw-r--r-- | src/pathfind.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/pathfind.cpp b/src/pathfind.cpp index 5b83998b2..ad2b40fae 100644 --- a/src/pathfind.cpp +++ b/src/pathfind.cpp @@ -152,8 +152,8 @@ static void TPFMode2(TrackPathFinder* tpf, TileIndex tile, DiagDirection directi if (++tpf->rd.cur_length > 50) return; - uint32 ts = GetTileTrackStatus(tile, tpf->tracktype, tpf->sub_type); - TrackBits bits = (TrackBits)((byte)((ts | (ts >> 8)) & _bits_mask[direction])); + TrackStatus ts = GetTileTrackStatus(tile, tpf->tracktype, tpf->sub_type); + TrackBits bits = (TrackBits)(TrackStatusToTrackBits(ts) & _bits_mask[direction]); if (bits == TRACK_BIT_NONE) return; assert(TileX(tile) != MapMaxX() && TileY(tile) != MapMaxY()); @@ -252,11 +252,11 @@ static void TPFMode1(TrackPathFinder* tpf, TileIndex tile, DiagDirection directi } } - uint32 bits = GetTileTrackStatus(tile, tpf->tracktype, tpf->sub_type); + uint32 bits = TrackStatusToTrackdirBits(GetTileTrackStatus(tile, tpf->tracktype, tpf->sub_type)); /* Check in case of rail if the owner is the same */ if (tpf->tracktype == TRANSPORT_RAIL) { - if (bits != 0 && GetTileTrackStatus(tile_org, TRANSPORT_RAIL, 0) != 0) { + if (bits != 0 && TrackStatusToTrackdirBits(GetTileTrackStatus(tile_org, TRANSPORT_RAIL, 0)) != TRACKDIR_BIT_NONE) { if (GetTileOwner(tile_org) != GetTileOwner(tile)) return; } } @@ -682,8 +682,8 @@ start_at: if (!IsTileType(tile, MP_RAILWAY) || !IsPlainRailTile(tile)) { /* We found a tile which is not a normal railway tile. * Determine which tracks that exist on this tile. */ - uint32 ts = GetTileTrackStatus(tile, TRANSPORT_RAIL, 0) & _tpfmode1_and[direction]; - bits = TrackdirBitsToTrackBits((TrackdirBits)(ts & TRACKDIR_BIT_MASK)); + TrackStatus ts = GetTileTrackStatus(tile, TRANSPORT_RAIL, 0) & _tpfmode1_and[direction]; + bits = TrackStatusToTrackBits(ts); /* Check that the tile contains exactly one track */ if (bits == 0 || KillFirstBit(bits) != 0) break; |