summaryrefslogtreecommitdiff
path: root/pathfind.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-06-10 08:37:41 +0000
committertron <tron@openttd.org>2006-06-10 08:37:41 +0000
commit0a72639c2d7254c37cd6f8ab0a9fa0f4d63fd2ea (patch)
treeddcc7798b94be03152e4b31cee4bf48bc73774e4 /pathfind.c
parent15c945c9263ffd64f01fd3da92fcb4efb17fe691 (diff)
downloadopenttd-0a72639c2d7254c37cd6f8ab0a9fa0f4d63fd2ea.tar.xz
(svn r5210) Many small changes which piled up: const, unsigned, variable scope, CSE for readability, DeMorgan, if cascades -> switch, whitespace, parentheses, bracing, misc.
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;