Mercurial > hg > openttd
diff src/tunnelbridge_cmd.cpp @ 8390:381a22f19287 draft
(svn r11960) -Cleanup: simplify some IsTunnel(Tile) / IsBridge(Tile) conditions
author | smatz <smatz@openttd.org> |
---|---|
date | Wed, 23 Jan 2008 14:51:36 +0000 |
parents | df9c00eb5699 |
children | a6304b304752 |
line wrap: on
line diff
--- a/src/tunnelbridge_cmd.cpp +++ b/src/tunnelbridge_cmd.cpp @@ -701,7 +701,7 @@ if (IsTunnel(tile)) { if (flags & DC_AUTO) return_cmd_error(STR_5006_MUST_DEMOLISH_TUNNEL_FIRST); return DoClearTunnel(tile, flags); - } else if (IsBridge(tile)) { // XXX Is this necessary? + } else { // IsBridge(tile) if (flags & DC_AUTO) return_cmd_error(STR_5007_MUST_DEMOLISH_BRIDGE_FIRST); return DoClearBridge(tile, flags); } @@ -879,7 +879,7 @@ AddSortableSpriteToDraw(SPR_EMPTY_BOUNDING_BOX, PAL_NONE, ti->x + BB_data[4], ti->y + BB_data[5], BB_data[6], BB_data[7], TILE_HEIGHT, ti->z); DrawBridgeMiddle(ti); - } else if (IsBridge(ti->tile)) { // XXX is this necessary? + } else { // IsBridge(ti->tile) const PalSpriteID *psid; int base_offset; bool ice = HasTunnelBridgeSnowOrDesert(ti->tile); @@ -943,8 +943,6 @@ } DrawBridgeMiddle(ti); - } else { - NOT_REACHED(); } } @@ -1113,7 +1111,7 @@ /* In the tunnel entrance? */ if (5 <= pos && pos <= 10) return z; - } else { + } else { // IsBridge(tile) DiagDirection dir = GetTunnelBridgeDirection(tile); uint pos = (DiagDirToAxis(dir) == AXIS_X ? y : x); @@ -1187,7 +1185,7 @@ if (IsTunnel(tile)) { td->str = (GetTunnelBridgeTransportType(tile) == TRANSPORT_RAIL) ? STR_5017_RAILROAD_TUNNEL : STR_5018_ROAD_TUNNEL; - } else { + } else { // IsBridge(tile) td->str = _bridge_tile_str[GetTunnelBridgeTransportType(tile) << 4 | GetBridgeType(tile)]; } td->owner = GetTileOwner(tile); @@ -1341,7 +1339,7 @@ return VETSB_ENTERED_WORMHOLE; } } - } else if (IsBridge(tile)) { // XXX is this necessary? + } else { // IsBridge(tile) DiagDirection dir; if (v->IsPrimaryVehicle()) {