src/ship_cmd.cpp
changeset 8890 8a0fa7ff70a0
parent 8862 f72f256c0259
child 8891 1058c3b69b7f
equal deleted inserted replaced
8889:553b2848bd36 8890:8a0fa7ff70a0
   910 	}
   910 	}
   911 
   911 
   912 	return CommandCost();
   912 	return CommandCost();
   913 }
   913 }
   914 
   914 
       
   915 bool Ship::FindClosestDepot(TileIndex *location, DestinationID *destination, bool *reverse)
       
   916 {
       
   917 	const Depot *depot = FindClosestShipDepot(this);
       
   918 
       
   919 	if (depot == NULL) return false;
       
   920 
       
   921 	if (location    != NULL) *location    = depot->xy;
       
   922 	if (destination != NULL) *destination = depot->index;
       
   923 
       
   924 	return true;
       
   925 }
       
   926 
   915 /** Send a ship to the depot.
   927 /** Send a ship to the depot.
   916  * @param tile unused
   928  * @param tile unused
   917  * @param flags type of operation
   929  * @param flags type of operation
   918  * @param p1 vehicle ID to send to the depot
   930  * @param p1 vehicle ID to send to the depot
   919  * @param p2 various bitmasked elements
   931  * @param p2 various bitmasked elements