Fix: pathfinders always tried to avoid docking tiles (even if nothing was on them) (#9522)
When coming across any docking tile (for example, all tiles around an oilrig are docking tiles), it always at least added a penalty of 3 times a normal tile, even when there are no ships on them. In result, the pathfinder got suggested to always go around docking tiles. This was most likely not the intention of the change made in31db4f8d5e
. (cherry picked from commitf87fe395a7
)
This commit is contained in:

committed by
Jonathan G Rennison

parent
bbe079c906
commit
91f2710783
@@ -311,7 +311,7 @@ static int32 NPFWaterPathCost(AyStar *as, AyStarNode *current, OpenListNode *par
|
||||
|
||||
if (IsDockingTile(current->tile)) {
|
||||
/* Check docking tile for occupancy */
|
||||
uint count = 1;
|
||||
uint count = 0;
|
||||
HasVehicleOnPos(current->tile, VEH_SHIP, &count, &CountShipProc);
|
||||
cost += count * 3 * _trackdir_length[trackdir];
|
||||
}
|
||||
|
@@ -287,7 +287,7 @@ public:
|
||||
|
||||
if (IsDockingTile(n.GetTile())) {
|
||||
/* Check docking tile for occupancy */
|
||||
uint count = 1;
|
||||
uint count = 0;
|
||||
HasVehicleOnPos(n.GetTile(), VEH_SHIP, &count, &CountShipProc);
|
||||
c += count * 3 * YAPF_TILE_LENGTH;
|
||||
}
|
||||
|
Reference in New Issue
Block a user