summaryrefslogtreecommitdiff
path: root/pathfind.c
diff options
context:
space:
mode:
Diffstat (limited to 'pathfind.c')
-rw-r--r--pathfind.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/pathfind.c b/pathfind.c
index 622b820f0..3e2b3f31f 100644
--- a/pathfind.c
+++ b/pathfind.c
@@ -180,7 +180,7 @@ static void TPFMode2(TrackPathFinder* tpf, TileIndex tile, DiagDirection directi
}
continue_here:;
- tpf->the_dir = HASBIT(_otherdir_mask[direction],i) ? (i+8) : i;
+ tpf->the_dir = i + (HASBIT(_otherdir_mask[direction], i) ? 8 : 0);
if (!tpf->enum_proc(tile, tpf->userdata, tpf->the_dir, tpf->rd.cur_length, NULL)) {
TPFMode2(tpf, tile, _tpf_new_direction[tpf->the_dir]);
@@ -754,8 +754,7 @@ start_at:
// Check that the tile contains exactly one track
if (bits == 0 || KILL_FIRST_BIT(bits) != 0) break;
- /* Check the rail type only if the train is *NOT* on top of
- * a bridge. */
+ /* Check the rail type only if the train is *NOT* on top of a bridge. */
if (!(IsBridgeTile(tile) && IsBridgeMiddle(tile) && GetBridgeAxis(tile) == DiagDirToAxis(direction))) {
if (IsTileType(tile, MP_STREET) ? !HASBIT(tpf->railtypes, GetRailTypeCrossing(tile)) : !HASBIT(tpf->railtypes, GetRailType(tile))) {
bits = 0;