Add setting to forbid the usage of pathfinding
This commit is contained in:
@@ -1,8 +1,15 @@
|
||||
import {getCenterFromGridPositionObj} from "./foundry_fixes.js";
|
||||
import {settingsKey} from "./settings.js";
|
||||
|
||||
// TODO Wipe cache if walls layer is being modified
|
||||
let cached_nodes = undefined;
|
||||
|
||||
export function is_pathfinding_enabled() {
|
||||
if (!game.settings.get(settingsKey, "allowPathfinding"))
|
||||
return false;
|
||||
return game.settings.get(settingsKey, "autoPathfinding") != game.keyboard.isDown("y")
|
||||
}
|
||||
|
||||
function get_node(pos, initialize=true) {
|
||||
if (!cached_nodes)
|
||||
// TODO Check if ceil is the right thing to do here
|
||||
|
||||
Reference in New Issue
Block a user