openttd.c
changeset 4000 4009d092b306
parent 3984 812dac315975
child 4032 ee1facd425d1
--- a/openttd.c	Fri Jun 09 20:06:02 2006 +0000
+++ b/openttd.c	Sat Jun 10 08:37:41 2006 +0000
@@ -1013,14 +1013,18 @@
 	TileIndex tile;
 
 	for (tile = 0; tile != MapSize(); tile++) {
-		if (IsTileType(tile, MP_STREET)) {
-			if (IsLevelCrossing(tile) && GetCrossingRoadOwner(tile) & 0x80) {
-				SetCrossingRoadOwner(tile, OWNER_TOWN);
-			}
+		switch (GetTileType(tile)) {
+			case MP_STREET:
+				if (IsLevelCrossing(tile) && GetCrossingRoadOwner(tile) & 0x80) {
+					SetCrossingRoadOwner(tile, OWNER_TOWN);
+				}
+				/* FALLTHROUGH */
 
-			if (GetTileOwner(tile) & 0x80) SetTileOwner(tile, OWNER_TOWN);
-		} else if (IsTileType(tile, MP_TUNNELBRIDGE)) {
-			if (GetTileOwner(tile) & 0x80) SetTileOwner(tile, OWNER_TOWN);
+			case MP_TUNNELBRIDGE:
+				if (GetTileOwner(tile) & 0x80) SetTileOwner(tile, OWNER_TOWN);
+				break;
+
+			default: break;
 		}
 	}
 }