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();
|
this.dragRulerRemovePathfindingWaypoints();
|
||||||
|
|
||||||
if (isToken && isPathfindingEnabled()) {
|
if (isToken && isPathfindingEnabled.call(this)) {
|
||||||
const from = getGridPositionFromPixelsObj(this.waypoints[this.waypoints.length - 1]);
|
const from = getGridPositionFromPixelsObj(this.waypoints[this.waypoints.length - 1]);
|
||||||
const to = getGridPositionFromPixelsObj(destination);
|
const to = getGridPositionFromPixelsObj(destination);
|
||||||
let path = findPath(from, to, this.draggedEntity, this.waypoints);
|
let path = findPath(from, to, this.draggedEntity, this.waypoints);
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ let cachedNodes = undefined;
|
|||||||
let use5105 = false;
|
let use5105 = false;
|
||||||
|
|
||||||
export function isPathfindingEnabled() {
|
export function isPathfindingEnabled() {
|
||||||
|
if (this.user !== game.user)
|
||||||
|
return false;
|
||||||
if (canvas.grid.type === CONST.GRID_TYPES.GRIDLESS)
|
if (canvas.grid.type === CONST.GRID_TYPES.GRIDLESS)
|
||||||
return false;
|
return false;
|
||||||
if (!game.user.isGM && !game.settings.get(settingsKey, "allowPathfinding"))
|
if (!game.user.isGM && !game.settings.get(settingsKey, "allowPathfinding"))
|
||||||
|
|||||||
Reference in New Issue
Block a user