(svn r21136) -Fix [FS#4213]: bridge speed limits should apply to all wagons of a vehicle, not just the head of the vehicle

This commit is contained in:
rubidium
2010-11-10 20:15:48 +00:00
parent cfbce19442
commit 06bb553545
3 changed files with 7 additions and 6 deletions

View File

@@ -1562,13 +1562,13 @@ static VehicleEnterTileStatus VehicleEnter_TunnelBridge(Vehicle *v, TileIndex ti
}
}
} else { // IsBridge(tile)
if (v->IsPrimaryVehicle() && v->type != VEH_SHIP) {
if (v->type != VEH_SHIP) {
/* modify speed of vehicle */
uint16 spd = GetBridgeSpec(GetBridgeType(tile))->speed;
if (v->type == VEH_ROAD) spd *= 2;
if (v->cur_speed > spd) v->cur_speed = spd;
Vehicle *first = v->First();
first->cur_speed = min(first->cur_speed, spd);
}
if (vdir == dir) {