# HG changeset patch # User tron # Date 1149866644 0 # Node ID ced0a23a5188a522507fdab4989d5351bbe4a6d6 # Parent 7e446b65ddf6a57358c0279fe7f226abf2d9ea7a (svn r5198) Fix some strange control flow: the case for MP_RAILWAY fell through the case for MP_TUNNELBRIDGE diff --git a/elrail.c b/elrail.c --- a/elrail.c +++ b/elrail.c @@ -352,14 +352,16 @@ sss->x_size, sss->y_size, sss->z_size, GetSlopeZ(ti->x, ti->y) + sss->z_offset); return; } - /* Fall through */ + break; + case MP_TUNNELBRIDGE: - if (IsBridgeTile(ti->tile) && IsBridgeMiddle(ti->tile) && GetRailTypeOnBridge(ti->tile) == RAILTYPE_ELECTRIC) DrawCatenaryOnBridge(ti); - /* Fall further */ - case MP_STREET: case MP_STATION: - DrawCatenaryRailway(ti); + if (IsBridge(ti->tile) && IsBridgeMiddle(ti->tile) && GetRailTypeOnBridge(ti->tile) == RAILTYPE_ELECTRIC) DrawCatenaryOnBridge(ti); break; - default: - break; + + case MP_STREET: break; + case MP_STATION: break; + + default: return; } + DrawCatenaryRailway(ti); }