Skip to content

Commit

Permalink
Check for wall collision as final step in TokenPF2e#canFlank
Browse files Browse the repository at this point in the history
  • Loading branch information
In3luki committed Oct 23, 2024
1 parent 45c30ce commit 1c3fd8a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/module/canvas/token/object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,15 @@ class TokenPF2e<TDocument extends TokenDocumentPF2e = TokenDocumentPF2e> extends

const reach = context.reach ?? actor.getReach({ action: "attack" });

return actor.canAttack && reach >= this.distanceTo(flankee, { reach });
return (
actor.canAttack &&
reach >= this.distanceTo(flankee, { reach }) &&
!CONFIG.Canvas.polygonBackends.move.testCollision(this.center, flankee.center, {
mode: "any",
type: "move",
source: new foundry.canvas.sources.PointMovementSource({ object: this }),
})
);
}

/**
Expand Down

0 comments on commit 1c3fd8a

Please sign in to comment.