summaryrefslogtreecommitdiff
path: root/src/ship_cmd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ship_cmd.cpp')
-rw-r--r--src/ship_cmd.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/ship_cmd.cpp b/src/ship_cmd.cpp
index 4f5b956d9..bcd04025f 100644
--- a/src/ship_cmd.cpp
+++ b/src/ship_cmd.cpp
@@ -912,6 +912,18 @@ CommandCost CmdStartStopShip(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
return CommandCost();
}
+bool Ship::FindClosestDepot(TileIndex *location, DestinationID *destination, bool *reverse)
+{
+ const Depot *depot = FindClosestShipDepot(this);
+
+ if (depot == NULL) return false;
+
+ if (location != NULL) *location = depot->xy;
+ if (destination != NULL) *destination = depot->index;
+
+ return true;
+}
+
/** Send a ship to the depot.
* @param tile unused
* @param flags type of operation