|
@@ -440,10 +440,9 @@ CommandCost CmdBuildAircraft(TileIndex t
|
|
|
*/
|
|
|
CommandCost CmdSellAircraft(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
|
|
|
{
|
|
|
Vehicle *v = Vehicle::GetIfValid(p1);
|
|
|
if (v == NULL) return CMD_ERROR;
|
|
|
Aircraft *v = Aircraft::GetIfValid(p1);
|
|
|
|
|
|
if (v->type != VEH_AIRCRAFT || !CheckOwnership(v->owner)) return CMD_ERROR;
|
|
|
if (v == NULL || !CheckOwnership(v->owner)) return CMD_ERROR;
|
|
|
if (!v->IsStoppedInDepot()) return_cmd_error(STR_ERROR_AIRCRAFT_MUST_BE_STOPPED);
|
|
|
|
|
|
if (HASBITS(v->vehstatus, VS_CRASHED)) return_cmd_error(STR_CAN_T_SELL_DESTROYED_VEHICLE);
|
|
@@ -493,11 +492,9 @@ CommandCost CmdSendAircraftToHangar(Tile
|
|
|
return SendAllVehiclesToDepot(VEH_AIRCRAFT, flags, p2 & DEPOT_SERVICE, _current_company, (p2 & VLW_MASK), p1);
|
|
|
}
|
|
|
|
|
|
Vehicle *v = Vehicle::GetIfValid(p1);
|
|
|
Aircraft *v = Aircraft::GetIfValid(p1);
|
|
|
if (v == NULL) return CMD_ERROR;
|
|
|
|
|
|
if (v->type != VEH_AIRCRAFT) return CMD_ERROR;
|
|
|
|
|
|
return v->SendToDepot(flags, (DepotCommand)(p2 & DEPOT_COMMAND_MASK));
|
|
|
}
|
|
|
|
|
@@ -516,10 +513,8 @@ CommandCost CmdRefitAircraft(TileIndex t
|
|
|
{
|
|
|
byte new_subtype = GB(p2, 8, 8);
|
|
|
|
|
|
Vehicle *v = Vehicle::GetIfValid(p1);
|
|
|
if (v == NULL) return CMD_ERROR;
|
|
|
|
|
|
if (v->type != VEH_AIRCRAFT || !CheckOwnership(v->owner)) return CMD_ERROR;
|
|
|
Aircraft *v = Aircraft::GetIfValid(p1);
|
|
|
if (v == NULL || !CheckOwnership(v->owner)) return CMD_ERROR;
|
|
|
if (!v->IsStoppedInDepot()) return_cmd_error(STR_ERROR_AIRCRAFT_MUST_BE_STOPPED);
|
|
|
if (v->vehstatus & VS_CRASHED) return_cmd_error(STR_CAN_T_REFIT_DESTROYED_VEHICLE);
|
|
|
|