diff options
author | tron <tron@openttd.org> | 2006-02-06 09:18:04 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2006-02-06 09:18:04 +0000 |
commit | 087fe86ed28fb6ac5885cac7f64d34ccd5a9c140 (patch) | |
tree | 3a4002304d8204d11c37ba706d6ffbd2e5dfac1b /ai | |
parent | 75a70e1def8c677d2340a49e9f12e4c2a5d65aee (diff) | |
download | openttd-087fe86ed28fb6ac5885cac7f64d34ccd5a9c140.tar.xz |
(svn r3564) Several smaller changes:
- Don't treat non-booleans as booleans
- Reduce variable scope
- Bracing
- Use DeMorgan's law to make conditionals easier to read
- if cascade -> switch
- Replace some magic numbers by symbolic names
- Avoid assignments within other statements
Diffstat (limited to 'ai')
-rw-r--r-- | ai/default/default.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/ai/default/default.c b/ai/default/default.c index c183caafc..9c639bea6 100644 --- a/ai/default/default.c +++ b/ai/default/default.c @@ -2778,8 +2778,7 @@ static bool AiEnumFollowRoad(TileIndex tile, AiRoadEnum *a, int track, uint leng if (dist <= a->best_dist) { TileIndex tile2 = TILE_MASK(tile + TileOffsByDir(_dir_by_track[track])); - if (IsTileType(tile2, MP_STREET) && - (_m[tile2].m5&0xF0) == 0) { + if (IsTileType(tile2, MP_STREET) && GB(_m[tile2].m5, 4, 4) == 0) { a->best_dist = dist; a->best_tile = tile; a->best_track = track; |