Migrate Drag Ruler to Terrain Ruler's new API

This commit is contained in:
Manuel Vögele
2021-04-10 14:43:45 +02:00
parent 35624a37aa
commit 8cd5d7f276
+1 -1
View File
@@ -17,7 +17,7 @@ export function highlightMeasurementTerrainRuler(ray, startDistance, tokenShape=
export function measureDistances(segments, token, shape, gridSpaces=true) {
const terrainRulerAvailable = game.modules.get("terrain-ruler")?.active && canvas.grid.type !== CONST.GRID_TYPES.GRIDLESS;
if (terrainRulerAvailable)
return game.terrainRuler.measureDistances(segments, {costFunction: (x, y) => getCostFromSpeedProvider(token, getAreaFromPositionAndShape({x, y}, shape), {x, y})});
return terrainRuler.measureDistances(segments, {costFunction: (x, y) => getCostFromSpeedProvider(token, getAreaFromPositionAndShape({x, y}, shape), {x, y})});
else
return canvas.grid.measureDistances(segments, { gridSpaces });
}