summaryrefslogtreecommitdiff
path: root/ai
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-02-06 09:18:04 +0000
committertron <tron@openttd.org>2006-02-06 09:18:04 +0000
commit453b30e387f8d8ab1839d96b0d1f9a8fea841292 (patch)
tree3a4002304d8204d11c37ba706d6ffbd2e5dfac1b /ai
parent0755bbead0240f519c9d78bb88ef4629d5ab8fa5 (diff)
downloadopenttd-453b30e387f8d8ab1839d96b0d1f9a8fea841292.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.c3
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;