diff src/train_cmd.cpp @ 16420:f74d1996f90c draft

(svn r21136) -Fix [FS#4213]: bridge speed limits should apply to all wagons of a vehicle, not just the head of the vehicle
author rubidium <rubidium@openttd.org>
date Wed, 10 Nov 2010 20:15:48 +0000
parents 5f42bbde0ea2
children ad58062bc5e1
line wrap: on
line diff
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -3296,8 +3296,8 @@
 			 * - for tunnels, only the part when the vehicle is not visible (part of enter/exit tile too)
 			 * - for bridges, only the middle part - without the bridge heads */
 			if (!(v->vehstatus & VS_HIDDEN)) {
-				v->cur_speed =
-					min(v->cur_speed, GetBridgeSpec(GetBridgeType(v->tile))->speed);
+				Train *first = v->First();
+				first->cur_speed = min(first->cur_speed, GetBridgeSpec(GetBridgeType(v->tile))->speed);
 			}
 
 			if (IsTileType(gp.new_tile, MP_TUNNELBRIDGE) && HasBit(VehicleEnterTile(v, gp.new_tile, gp.x, gp.y), VETS_ENTERED_WORMHOLE)) {