Reduce broken caching

This commit is contained in:
Manuel Vögele
2021-05-19 19:16:20 +02:00
parent 310014bb8a
commit 54cebc3192
2 changed files with 6 additions and 0 deletions
+4
View File
@@ -92,3 +92,7 @@ export function find_path(from, to) {
} }
return path; return path;
} }
export function wipe_cache() {
cached_nodes = undefined;
}
+2
View File
@@ -2,6 +2,7 @@ import {currentSpeedProvider, getColorForDistanceAndToken, getRangesFromSpeedPro
import {getHexSizeSupportTokenGridCenter} from "./compatibility.js"; import {getHexSizeSupportTokenGridCenter} from "./compatibility.js";
import {cancelScheduledMeasurement, measure} from "./foundry_imports.js" import {cancelScheduledMeasurement, measure} from "./foundry_imports.js"
import {getMovementHistory} from "./movement_tracking.js"; import {getMovementHistory} from "./movement_tracking.js";
import {wipe_cache} from "./pathfinding.js";
import {settingsKey} from "./settings.js"; import {settingsKey} from "./settings.js";
import {getSnapPointForEntity} from "./util.js"; import {getSnapPointForEntity} from "./util.js";
@@ -176,6 +177,7 @@ export function extendRuler() {
return; return;
const ruler = canvas.controls.ruler; const ruler = canvas.controls.ruler;
ruler.clear(); ruler.clear();
wipe_cache();
ruler._state = Ruler.STATES.STARTING; ruler._state = Ruler.STATES.STARTING;
let entityCenter; let entityCenter;
if (isToken && canvas.grid.isHex && game.modules.get("hex-size-support")?.active && CONFIG.hexSizeSupport.getAltSnappingFlag(entity)) if (isToken && canvas.grid.isHex && game.modules.get("hex-size-support")?.active && CONFIG.hexSizeSupport.getAltSnappingFlag(entity))