Avoid unnecessary diagonal calculation on hex grids

This commit is contained in:
Manuel Vögele
2022-01-30 10:16:19 +01:00
parent 4a5b9bbb11
commit 1972498b05
+1 -1
View File
@@ -83,7 +83,7 @@ function calculatePath(from, to, previousWaypoints) {
if (canvas.grid.diagonalRule === "5105")
use5105 = true;
let startLayer = 0;
if (use5105) {
if (use5105 && canvas.grid.type === CONST.GRID_TYPES.SQUARE) {
previousWaypoints = previousWaypoints.map(w => getGridPositionFromPixelsObj(w));
startLayer = calcNoDiagonals(previousWaypoints) % 2;
}