From 453b30e387f8d8ab1839d96b0d1f9a8fea841292 Mon Sep 17 00:00:00 2001 From: tron Date: Mon, 6 Feb 2006 09:18:04 +0000 Subject: (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 --- road_cmd.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'road_cmd.c') 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); } -- cgit v1.2.3-70-g09d2