diff -r 553b2848bd36 -r 8a0fa7ff70a0 src/ship_cmd.cpp --- a/src/ship_cmd.cpp Thu Apr 10 22:18:33 2008 +0000 +++ b/src/ship_cmd.cpp Fri Apr 11 08:14:43 2008 +0000 @@ -912,6 +912,18 @@ 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