From 0b45861575918a79ac672c273730760741eae643 Mon Sep 17 00:00:00 2001 From: Shark that walks like a man <106829671+stwlam@users.noreply.github.com> Date: Mon, 10 Jun 2024 19:27:15 -0500 Subject: [PATCH] Include thrown traits in `isRanged` test for melee items (#15048) --- src/module/item/melee/document.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/module/item/melee/document.ts b/src/module/item/melee/document.ts index d05ec4df8ff..159c481b7c8 100644 --- a/src/module/item/melee/document.ts +++ b/src/module/item/melee/document.ts @@ -31,11 +31,12 @@ class MeleePF2e extends Ite } get isRanged(): boolean { - return this.system.traits.value.some((t) => t.startsWith("range-")); + const traitPattern = /^(?:range|thrown)-/; + return this.system.traits.value.some((t) => traitPattern.test(t)); } get isThrown(): boolean { - return this.isRanged && this.system.traits.value.some((t) => t.startsWith("thrown")); + return this.isRanged && this.system.traits.value.some((t) => t.startsWith("thrown-")); } /** The attribute this attack is based on: determines which of the Clumsy and Enfeebled conditions apply */