(svn r12657) -Codechange: add 'FindClosestDepot' to the vehicle class.

This commit is contained in:
rubidium
2008-04-11 08:14:43 +00:00
parent 3a0cb23548
commit 62bdc381e7
9 changed files with 73 additions and 4 deletions

View File

@@ -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