mirror of https://github.com/OpenTTD/OpenTTD
Change: Get a better depot when close to destination tile of depots.
parent
01ac0e653f
commit
e91483c588
|
@ -496,6 +496,13 @@ static void ShipArrivesAt(const Vehicle *v, Station *st)
|
|||
*/
|
||||
static Track ChooseShipTrack(Ship *v, TileIndex tile, TrackBits tracks)
|
||||
{
|
||||
/* Before choosing a track, if close to the destination station or depot (not an oil rig)... */
|
||||
if (DistanceManhattan(v->dest_tile, tile) <= 5 && (v->current_order.IsType(OT_GOTO_DEPOT) &&
|
||||
(!IsShipDepotTile(v->dest_tile) || (IsExtendedDepotTile(v->dest_tile) && !IsExtendedDepotEmpty(v->dest_tile))))) {
|
||||
/* Try to get a depot tile. */
|
||||
v->dest_tile = Depot::Get(v->current_order.GetDestination())->GetBestDepotTile(v);
|
||||
}
|
||||
|
||||
bool path_found = true;
|
||||
Track track;
|
||||
|
||||
|
|
Loading…
Reference in New Issue