Don't perform pathfinding on other player's rulers

This commit is contained in:
Manuel Vögele
2022-02-03 17:59:35 +01:00
parent 1509307313
commit 56e15be4ca
2 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -168,7 +168,7 @@ export function measure(destination, options={}) {
this.dragRulerRemovePathfindingWaypoints();
if (isToken && isPathfindingEnabled()) {
if (isToken && isPathfindingEnabled.call(this)) {
const from = getGridPositionFromPixelsObj(this.waypoints[this.waypoints.length - 1]);
const to = getGridPositionFromPixelsObj(destination);
let path = findPath(from, to, this.draggedEntity, this.waypoints);
+2
View File
@@ -8,6 +8,8 @@ let cachedNodes = undefined;
let use5105 = false;
export function isPathfindingEnabled() {
if (this.user !== game.user)
return false;
if (canvas.grid.type === CONST.GRID_TYPES.GRIDLESS)
return false;
if (!game.user.isGM && !game.settings.get(settingsKey, "allowPathfinding"))