From 64a6d3daad312145da48d6f053266215077780d7 Mon Sep 17 00:00:00 2001 From: rubidium Date: Sun, 14 Oct 2007 20:12:51 +0000 Subject: (svn r11262) -Fix [FS#1330]: do not check for vehicles that are not on the ground when removing owned land, furthermore do not check for shadows (of aircraft). --- src/clear_cmd.cpp | 2 +- src/vehicle.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/clear_cmd.cpp b/src/clear_cmd.cpp index 77f42552b..a39bf24a6 100644 --- a/src/clear_cmd.cpp +++ b/src/clear_cmd.cpp @@ -480,7 +480,7 @@ CommandCost CmdSellLandArea(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) if (!CheckTileOwnership(tile) && _current_player != OWNER_WATER) return CMD_ERROR; - if (!EnsureNoVehicle(tile)) return CMD_ERROR; + if (!EnsureNoVehicleOnGround(tile)) return CMD_ERROR; if (flags & DC_EXEC) DoClearSquare(tile); diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 7e60e3bad..56ce50b5d 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -119,7 +119,7 @@ StringID VehicleInTheWayErrMsg(const Vehicle* v) static void *EnsureNoVehicleProc(Vehicle *v, void *data) { - if (v->tile != *(const TileIndex*)data || v->type == VEH_DISASTER) + if (v->tile != *(const TileIndex*)data || v->type == VEH_DISASTER || (v->type == VEH_AIRCRAFT && v->subtype == AIR_SHADOW)) return NULL; _error_message = VehicleInTheWayErrMsg(v); @@ -135,7 +135,7 @@ static void *EnsureNoVehicleProcZ(Vehicle *v, void *data) { const TileInfo *ti = (const TileInfo*)data; - if (v->tile != ti->tile || v->type == VEH_DISASTER) return NULL; + if (v->tile != ti->tile || v->type == VEH_DISASTER || (v->type == VEH_AIRCRAFT && v->subtype == AIR_SHADOW)) return NULL; if (v->z_pos > ti->z) return NULL; _error_message = VehicleInTheWayErrMsg(v); -- cgit v1.2.3-54-g00ecf