diff options
author | tron <tron@openttd.org> | 2005-11-13 14:54:09 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2005-11-13 14:54:09 +0000 |
commit | 4a14a586e2f457d38e9fede1a494478105a8acfd (patch) | |
tree | 0bcf189f35802c7769cd23e20ed58a18b59d9b2e /rail_cmd.c | |
parent | ee15e3de13643b2d09abcc5424bf8e2d916cff75 (diff) | |
download | openttd-4a14a586e2f457d38e9fede1a494478105a8acfd.tar.xz |
(svn r3173) Use the trinary operator and switch to improve readability
Also align short cases nicely
Diffstat (limited to 'rail_cmd.c')
-rw-r--r-- | rail_cmd.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/rail_cmd.c b/rail_cmd.c index fe354dc6c..a5c48743d 100644 --- a/rail_cmd.c +++ b/rail_cmd.c @@ -2003,21 +2003,20 @@ static void TileLoop_Track(TileIndex tile) m2 = GB(_m[tile].m2, 0, 4); - /* special code for alps landscape */ - if (_opt.landscape == LT_HILLY) { - /* convert into snow? */ - if (GetTileZ(tile) > _opt.snow_line) { - a2 = RAIL_GROUND_ICE_DESERT; - goto modify_me; - } + switch (_opt.landscape) { + case LT_HILLY: + if (GetTileZ(tile) > _opt.snow_line) { /* convert into snow? */ + a2 = RAIL_GROUND_ICE_DESERT; + goto modify_me; + } + break; - /* special code for desert landscape */ - } else if (_opt.landscape == LT_DESERT) { - /* convert into desert? */ - if (GetMapExtraBits(tile) == 1) { - a2 = RAIL_GROUND_ICE_DESERT; - goto modify_me; - } + case LT_DESERT: + if (GetMapExtraBits(tile) == 1) { /* convert into desert? */ + a2 = RAIL_GROUND_ICE_DESERT; + goto modify_me; + } + break; } // Don't continue tile loop for depots |