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 | 453b30e387f8d8ab1839d96b0d1f9a8fea841292 (patch) | |
tree | 3a4002304d8204d11c37ba706d6ffbd2e5dfac1b /road_cmd.c | |
parent | 0755bbead0240f519c9d78bb88ef4629d5ab8fa5 (diff) | |
download | openttd-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 'road_cmd.c')
-rw-r--r-- | road_cmd.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/road_cmd.c b/road_cmd.c index 85a029585..1c8952cd3 100644 --- a/road_cmd.c +++ b/road_cmd.c @@ -1112,9 +1112,8 @@ static const StringID _road_tile_strings[] = { static void GetTileDesc_Road(TileIndex tile, TileDesc *td) { - int i = (_m[tile].m5 >> 4); - if (i == 0) - i = GB(_m[tile].m4, 4, 3) + 3; + int i = GB(_m[tile].m5, 4, 4); + if (i == 0) i = GB(_m[tile].m4, 4, 3) + 3; td->str = _road_tile_strings[i - 1]; td->owner = GetTileOwner(tile); } |