src/roadveh_cmd.cpp
changeset 10126 bed2d9d38577
parent 10098 00ebbccc6181
child 10127 ab5e35f77e87
equal deleted inserted replaced
10125:64de1e83efa8 10126:bed2d9d38577
   442 			if (rfdd.best_length != UINT_MAX) return GetDepotByTile(rfdd.tile);
   442 			if (rfdd.best_length != UINT_MAX) return GetDepotByTile(rfdd.tile);
   443 		} break;
   443 		} break;
   444 	}
   444 	}
   445 
   445 
   446 	return NULL; /* Target not found */
   446 	return NULL; /* Target not found */
       
   447 }
       
   448 
       
   449 bool RoadVehicle::FindClosestDepot(TileIndex *location, DestinationID *destination, bool *reverse)
       
   450 {
       
   451 	const Depot *depot = FindClosestRoadDepot(this);
       
   452 
       
   453 	if (depot == NULL) return false;
       
   454 
       
   455 	if (location    != NULL) *location    = depot->xy;
       
   456 	if (destination != NULL) *destination = depot->index;
       
   457 
       
   458 	return true;
   447 }
   459 }
   448 
   460 
   449 /** Send a road vehicle to the depot.
   461 /** Send a road vehicle to the depot.
   450  * @param tile unused
   462  * @param tile unused
   451  * @param flags operation to perform
   463  * @param flags operation to perform