Wipe gridless cache if the wall layout changes
This commit is contained in:
+8
-1
@@ -47,10 +47,17 @@ export function findPath(from, to, token, previousWaypoints) {
|
||||
}
|
||||
}
|
||||
|
||||
export function wipePathfindingCache() {
|
||||
export function wipeGriddedPathfindingCache() {
|
||||
cachedNodes = undefined;
|
||||
}
|
||||
|
||||
export function wipeGridlessPathfindingCache() {
|
||||
if (gridlessPathfinder) {
|
||||
GridlessPathfinding.free(gridlessPathfinder);
|
||||
gridlessPathfinder = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
function getNode(pos, token, initialize=true) {
|
||||
pos = {layer: 0, ...pos}; // Copy pos and set pos.layer to the default value if it's unset
|
||||
if (!cachedNodes)
|
||||
|
||||
Reference in New Issue
Block a user