diff --git a/src/pathfinder/yapf/yapf_costrail.hpp b/src/pathfinder/yapf/yapf_costrail.hpp index 5098ca24e5..1549467189 100644 --- a/src/pathfinder/yapf/yapf_costrail.hpp +++ b/src/pathfinder/yapf/yapf_costrail.hpp @@ -482,8 +482,8 @@ public: int y1 = 2 * TileY(prev.tile); int x2 = 2 * TileX(cur.tile); int y2 = 2 * TileY(cur.tile); - int dx = abs(x1 - x2) + 1; - int dy = abs(y1 - y2) + 1; + int dx = abs(x1 - x2) + 4; // up to 2x track exit dir tile offsets in opposite directions + int dy = abs(y1 - y2) + 4; // " int dmin = min(dx, dy); int dxy = abs(dx - dy); segment_entry_cost += dmin * YAPF_TILE_CORNER_LENGTH + (dxy - 1) * (YAPF_TILE_LENGTH / 2);