From 0a72639c2d7254c37cd6f8ab0a9fa0f4d63fd2ea Mon Sep 17 00:00:00 2001 From: tron Date: Sat, 10 Jun 2006 08:37:41 +0000 Subject: (svn r5210) Many small changes which piled up: const, unsigned, variable scope, CSE for readability, DeMorgan, if cascades -> switch, whitespace, parentheses, bracing, misc. --- pathfind.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'pathfind.c') 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; -- cgit v1.2.3-54-g00ecf