summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-07-26 05:57:30 +0000
committertron <tron@openttd.org>2006-07-26 05:57:30 +0000
commitec109a8e8f08c276c568ae492d664358bb5c4f9a (patch)
tree439f54a8d7f795e602cbcbe32d6794394643c47f
parent6082507fea5070cfa7846a4bc9b0c02706fbeee7 (diff)
downloadopenttd-ec109a8e8f08c276c568ae492d664358bb5c4f9a.tar.xz
(svn r5610) Remove a pointless call to VehicleInTheWayErrMsg() - only trains can be on rail bridges
-rw-r--r--tunnelbridge_cmd.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/tunnelbridge_cmd.c b/tunnelbridge_cmd.c
index 8d7bc92fc..ead5e9722 100644
--- a/tunnelbridge_cmd.c
+++ b/tunnelbridge_cmd.c
@@ -792,20 +792,16 @@ int32 DoConvertTunnelBridgeRail(TileIndex tile, RailType totype, bool exec)
}
return _price.build_rail >> 1;
} else if (IsBridge(tile) && IsBridgeRamp(tile) && GetBridgeTransportType(tile) == TRANSPORT_RAIL) {
- const Vehicle* v;
TileIndexDiff delta;
int32 cost;
if (!CheckTileOwnership(tile)) return CMD_ERROR;
endtile = GetOtherBridgeEnd(tile);
- // Make sure there's no vehicle on the bridge
- v = FindVehicleBetween(tile, endtile, GetBridgeHeightRamp(tile));
- if (v != NULL) {
- return_cmd_error(VehicleInTheWayErrMsg(v));
- }
- if (!EnsureNoVehicle(tile) || !EnsureNoVehicle(endtile)) {
+ if (!EnsureNoVehicle(tile) ||
+ !EnsureNoVehicle(endtile) ||
+ FindVehicleBetween(tile, endtile, GetBridgeHeightRamp(tile)) != NULL) {
return_cmd_error(STR_8803_TRAIN_IN_THE_WAY);
}