Don't perform pathfinding on other player's rulers
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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"))
|
||||
|
||||
Reference in New Issue
Block a user