summaryrefslogtreecommitdiff
path: root/src/ship_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-08-17 23:55:22 +0000
committerrubidium <rubidium@openttd.org>2010-08-17 23:55:22 +0000
commit4780cc50b200400bb1d05f22532041cd6edd3dc9 (patch)
treee24d66b398e2d985fcf622df277b730b887afcdb /src/ship_cmd.cpp
parentc14853b72e38f23d034e737450b5e894ba794e12 (diff)
downloadopenttd-4780cc50b200400bb1d05f22532041cd6edd3dc9.tar.xz
(svn r20532) -Codechange: unify selling of vehicles a bit
Diffstat (limited to 'src/ship_cmd.cpp')
-rw-r--r--src/ship_cmd.cpp32
1 files changed, 0 insertions, 32 deletions
diff --git a/src/ship_cmd.cpp b/src/ship_cmd.cpp
index 1b0bb2421..49afb753a 100644
--- a/src/ship_cmd.cpp
+++ b/src/ship_cmd.cpp
@@ -668,38 +668,6 @@ CommandCost CmdBuildShip(TileIndex tile, DoCommandFlag flags, const Engine *e, u
return CommandCost();
}
-/**
- * Sell a ship.
- * @param tile unused
- * @param flags type of operation
- * @param p1 vehicle ID to be sold
- * @param p2 unused
- * @param text unused
- * @return the cost of this operation or an error
- */
-CommandCost CmdSellShip(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
-{
- Ship *v = Ship::GetIfValid(p1);
- if (v == NULL) return CMD_ERROR;
-
- CommandCost ret = CheckOwnership(v->owner);
- if (ret.Failed()) return ret;
-
- if (v->vehstatus & VS_CRASHED) return_cmd_error(STR_ERROR_VEHICLE_IS_DESTROYED);
-
- if (!v->IsStoppedInDepot()) {
- return_cmd_error(STR_ERROR_SHIP_MUST_BE_STOPPED_IN_DEPOT);
- }
-
- ret = CommandCost(EXPENSES_NEW_VEHICLES, -v->value);
-
- if (flags & DC_EXEC) {
- delete v;
- }
-
- return ret;
-}
-
bool Ship::FindClosestDepot(TileIndex *location, DestinationID *destination, bool *reverse)
{
const Depot *depot = FindClosestShipDepot(this, 0);