Properly store terrain ruler's state in the movement history

This commit is contained in:
Manuel Vögele
2021-05-11 19:01:51 +02:00
parent 85e167af45
commit 286aaf7ada
4 changed files with 13 additions and 7 deletions
+2 -2
View File
@@ -56,9 +56,9 @@ function calculateUpdate(combat, token, rays) {
// Ignore rays that have the same start and end coordinates
if (ray.A.x !== ray.B.x || ray.A.y !== ray.B.y) {
if (terrainRulerAvailable) {
measureDistances([{ray}], token, getTokenShape(token), true, {terrainRulerInitialState: dragRulerFlags.rulerState});
measureDistances([{ray}], token, getTokenShape(token), {terrainRulerInitialState: waypoints[waypoints.length - 1]?.dragRulerFinalState});
ray.A.dragRulerVisitedSpaces = ray.terrainRulerVisitedSpaces;
dragRulerFlags.rulerState = ray.terrainRulerFinalState;
ray.A.dragRulerFinalState = ray.terrainRulerFinalState;
}
waypoints.push(ray.A);
}