mirror of https://github.com/OpenTTD/OpenTTD
(svn r5260) -Fix: It was possible to convert the railtype of a bridge while a train was on it
parent
f5638395fe
commit
17c15fab3e
|
@ -788,7 +788,6 @@ int32 DoConvertTunnelBridgeRail(TileIndex tile, RailType totype, bool exec)
|
||||||
}
|
}
|
||||||
return _price.build_rail >> 1;
|
return _price.build_rail >> 1;
|
||||||
} else if (IsBridge(tile) && IsBridgeRamp(tile) && GetBridgeTransportType(tile) == TRANSPORT_RAIL) {
|
} else if (IsBridge(tile) && IsBridgeRamp(tile) && GetBridgeTransportType(tile) == TRANSPORT_RAIL) {
|
||||||
uint z = TilePixelHeight(tile) + TILE_HEIGHT;
|
|
||||||
const Vehicle* v;
|
const Vehicle* v;
|
||||||
TileIndexDiff delta;
|
TileIndexDiff delta;
|
||||||
int32 cost;
|
int32 cost;
|
||||||
|
@ -797,7 +796,7 @@ int32 DoConvertTunnelBridgeRail(TileIndex tile, RailType totype, bool exec)
|
||||||
|
|
||||||
endtile = GetOtherBridgeEnd(tile);
|
endtile = GetOtherBridgeEnd(tile);
|
||||||
// Make sure there's no vehicle on the bridge
|
// Make sure there's no vehicle on the bridge
|
||||||
v = FindVehicleBetween(tile, endtile, z);
|
v = FindVehicleBetween(tile, endtile, GetBridgeHeightRamp(tile));
|
||||||
if (v != NULL) {
|
if (v != NULL) {
|
||||||
return_cmd_error(VehicleInTheWayErrMsg(v));
|
return_cmd_error(VehicleInTheWayErrMsg(v));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue