From 4780cc50b200400bb1d05f22532041cd6edd3dc9 Mon Sep 17 00:00:00 2001 From: rubidium Date: Tue, 17 Aug 2010 23:55:22 +0000 Subject: (svn r20532) -Codechange: unify selling of vehicles a bit --- src/aircraft_cmd.cpp | 30 ------------------------------ 1 file changed, 30 deletions(-) (limited to 'src/aircraft_cmd.cpp') diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp index fe1f62113..2e710bc12 100644 --- a/src/aircraft_cmd.cpp +++ b/src/aircraft_cmd.cpp @@ -338,36 +338,6 @@ CommandCost CmdBuildAircraft(TileIndex tile, DoCommandFlag flags, const Engine * } -/** - * Sell an aircraft. - * @param tile unused - * @param flags for command type - * @param p1 vehicle ID to be sold - * @param p2 unused - * @param text unused - * @return the cost of this operation or an error - */ -CommandCost CmdSellAircraft(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text) -{ - Aircraft *v = Aircraft::GetIfValid(p1); - if (v == NULL) return CMD_ERROR; - - CommandCost ret = CheckOwnership(v->owner); - if (ret.Failed()) return ret; - - if (!v->IsStoppedInDepot()) return_cmd_error(STR_ERROR_AIRCRAFT_MUST_BE_STOPPED); - - if (v->vehstatus & VS_CRASHED) return_cmd_error(STR_ERROR_VEHICLE_IS_DESTROYED); - - ret = CommandCost(EXPENSES_NEW_VEHICLES, -v->value); - - if (flags & DC_EXEC) { - delete v; - } - - return ret; -} - bool Aircraft::FindClosestDepot(TileIndex *location, DestinationID *destination, bool *reverse) { const Station *st = GetTargetAirportIfValid(this); -- cgit v1.2.3-54-g00ecf