tunnelbridge_cmd.c
changeset 3881 b2a66893f250
parent 3878 91a8b87f641e
child 3900 4984308f9125
--- a/tunnelbridge_cmd.c	Sat May 20 21:04:43 2006 +0000
+++ b/tunnelbridge_cmd.c	Sun May 21 11:34:08 2006 +0000
@@ -656,10 +656,7 @@
 		endtile - delta,
 		GetBridgeHeightRamp(tile) + TILE_HEIGHT
 	);
-	if (v != NULL) {
-		VehicleInTheWayErrMsg(v);
-		return CMD_ERROR;
-	}
+	if (v != NULL) return_cmd_error(VehicleInTheWayErrMsg(v));
 
 	t = ClosestTownFromTile(tile, (uint)-1); //needed for town rating penalty
 	// check if you're allowed to remove the bridge owned by a town.
@@ -770,13 +767,11 @@
 		// Make sure there's no vehicle on the bridge
 		v = FindVehicleBetween(tile, endtile, z);
 		if (v != NULL) {
-			VehicleInTheWayErrMsg(v);
-			return CMD_ERROR;
+			return_cmd_error(VehicleInTheWayErrMsg(v));
 		}
 
 		if (!EnsureNoVehicle(tile) || !EnsureNoVehicle(endtile)) {
-			_error_message = STR_8803_TRAIN_IN_THE_WAY;
-			return CMD_ERROR;
+			return_cmd_error(STR_8803_TRAIN_IN_THE_WAY);
 		}
 
 		if (GetRailType(tile) == totype) return CMD_ERROR;