summaryrefslogtreecommitdiff
path: root/rail_cmd.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-11-13 14:54:09 +0000
committertron <tron@openttd.org>2005-11-13 14:54:09 +0000
commit53f00c8f9de83c73742ed6a746e6e7aec535b26a (patch)
tree0bcf189f35802c7769cd23e20ed58a18b59d9b2e /rail_cmd.c
parent81e5b16d7178f0ee5584201cb2f6c8e36742354f (diff)
downloadopenttd-53f00c8f9de83c73742ed6a746e6e7aec535b26a.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.c27
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