(svn r5610) Remove a pointless call to VehicleInTheWayErrMsg() - only trains can be on rail bridges
authortron
Wed, 26 Jul 2006 05:57:30 +0000
changeset 4172 1410bc66fdc7
parent 4171 5c6e60c392c3
child 4173 0744150b6ffc
(svn r5610) Remove a pointless call to VehicleInTheWayErrMsg() - only trains can be on rail bridges
tunnelbridge_cmd.c
--- a/tunnelbridge_cmd.c	Wed Jul 26 03:33:12 2006 +0000
+++ b/tunnelbridge_cmd.c	Wed Jul 26 05:57:30 2006 +0000
@@ -792,20 +792,16 @@
 		}
 		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);
 		}