Pass enableTerrainRuler option to all measureDistances calls

This fixes a regression introduced with e1265ad6fb
This commit is contained in:
Manuel Vögele
2021-11-21 20:57:26 +01:00
parent a3be4ceb03
commit 39f7bab4b6
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -131,10 +131,11 @@ export function getColorForDistanceAndToken(distance, token, ranges=null) {
}
export function getMovedDistanceFromToken(token) {
const terrainRulerAvailable = game.modules.get("terrain-ruler")?.active;
const history = getMovementHistory(token);
const segments = Ruler.dragRulerGetRaysFromWaypoints(history, {x: token.x, y: token.y}).map(ray => {return {ray}});
const shape = getTokenShape(token);
const distances = measureDistances(segments, token, shape);
const distances = measureDistances(segments, token, shape, {enableTerrainRuler: terrainRulerAvailable});
// Sum up the distances
return distances.reduce((acc, val) => acc + val, 0);
}