(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
This commit is contained in:
tron
2006-02-06 09:18:04 +00:00
parent 75a70e1def
commit 087fe86ed2
23 changed files with 218 additions and 212 deletions

View File

@@ -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;