road_cmd.c
branch0.5
changeset 5483 a0d5f45dbdcf
parent 5481 acf12c0e6f31
child 5536 11b3dd55f6f4
--- a/road_cmd.c	Tue Apr 10 09:49:41 2007 +0000
+++ b/road_cmd.c	Tue Apr 10 09:57:35 2007 +0000
@@ -308,7 +308,7 @@
 					if ((existing & pieces) == pieces) {
 						return_cmd_error(STR_1007_ALREADY_BUILT);
 					}
-					if (!EnsureNoVehicle(tile)) return CMD_ERROR;
+					if (!EnsureNoVehicleOnGround(tile)) return CMD_ERROR;
 					break;
 
 				case ROAD_TILE_CROSSING:
@@ -352,7 +352,7 @@
 				default: goto do_clear;
 			}
 
-			if (!EnsureNoVehicle(tile)) return CMD_ERROR;
+			if (!EnsureNoVehicleOnGround(tile)) return CMD_ERROR;
 
 			if (flags & DC_EXEC) {
 				YapfNotifyTrackLayoutChange(tile, FIND_FIRST_BIT(GetTrackBits(tile)));
@@ -436,7 +436,7 @@
 	if (!IsLevelCrossing(tile)) return CMD_ERROR;
 
 	// not owned by me?
-	if (!CheckTileOwnership(tile) || !EnsureNoVehicle(tile)) return CMD_ERROR;
+	if (!CheckTileOwnership(tile) || !EnsureNoVehicleOnGround(tile)) return CMD_ERROR;
 
 	if (GetRailTypeCrossing(tile) == totype) return CMD_ERROR;
 
@@ -581,7 +581,7 @@
 
 	if (p1 > 3) return CMD_ERROR; // check direction
 
-	if (!EnsureNoVehicle(tile)) return CMD_ERROR;
+	if (!EnsureNoVehicleOnGround(tile)) return CMD_ERROR;
 
 	tileh = GetTileSlope(tile, NULL);
 	if (tileh != SLOPE_FLAT && (
@@ -947,7 +947,7 @@
 			if (t->road_build_months != 0 &&
 					(DistanceManhattan(t->xy, tile) < 8 || grp != 0) &&
 					GetRoadTileType(tile) == ROAD_TILE_NORMAL && (GetRoadBits(tile) == ROAD_X || GetRoadBits(tile) == ROAD_Y)) {
-				if (GetTileSlope(tile, NULL) == SLOPE_FLAT && EnsureNoVehicle(tile) && CHANCE16(1, 20)) {
+				if (GetTileSlope(tile, NULL) == SLOPE_FLAT && EnsureNoVehicleOnGround(tile) && CHANCE16(1, 20)) {
 					StartRoadWorks(tile);
 
 					SndPlayTileFx(SND_21_JACKHAMMER, tile);