1
0
Fork 0

Change: Get a better depot when close to destination tile of depots.

pull/8480/head
J0anJosep 2020-12-24 00:34:54 +01:00
parent 01ac0e653f
commit e91483c588
1 changed files with 7 additions and 0 deletions

View File

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