mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-21 05:29:11 +00:00
(svn r3173) Use the trinary operator and switch to improve readability
Also align short cases nicely
This commit is contained in:
27
rail_cmd.c
27
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
|
||||
|
Reference in New Issue
Block a user