1
0
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:
tron
2005-11-13 14:54:09 +00:00
parent ee15e3de13
commit 4a14a586e2
15 changed files with 235 additions and 305 deletions

View File

@@ -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