From afcbba8d6b16df43d1e3c5cd2bb6594c17503a2e Mon Sep 17 00:00:00 2001 From: J0anJosep Date: Fri, 25 Dec 2020 15:06:18 +0100 Subject: [PATCH] Add: Do not try to cross an extended depot that has a ship inside. --- src/pathfinder/yapf/yapf_ship.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/pathfinder/yapf/yapf_ship.cpp b/src/pathfinder/yapf/yapf_ship.cpp index 57d5e9d877..b2b998ba8b 100644 --- a/src/pathfinder/yapf/yapf_ship.cpp +++ b/src/pathfinder/yapf/yapf_ship.cpp @@ -382,6 +382,10 @@ public: c += count * 3 * YAPF_TILE_LENGTH; } + if (IsShipDepotTile(n.GetTile())) { + if (IsExtendedDepot(n.GetTile()) && IsDepotFullWithStoppedVehicles(n.GetTile())) c += YAPF_INFINITE_PENALTY; + } + /* Skipped tile cost for aqueducts. */ c += YAPF_TILE_LENGTH * tf->m_tiles_skipped;