Skip to content

Commit

Permalink
Resolve item alteration id for singleItem and additionalItems
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlosFdez committed Feb 2, 2025
1 parent 09c8ea0 commit 006467c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/module/rules/rule-element/item-alteration/rule-element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,13 @@ class ItemAlterationRuleElement extends RuleElementPF2e<ItemAlterationRuleSchema
if (this.ignored) return;

try {
const itemId = this.itemId ? this.resolveInjectedProperties(this.itemId) : null;
const items = singleItem
? singleItem.id === this.itemId || singleItem.type === this.itemType
? singleItem.id === itemId || singleItem.type === this.itemType
? [singleItem]
: []
: this.#getItemsOfType();
items.push(
...additionalItems.filter((i) => (this.itemId && i.id === this.itemId) || this.itemType === i.type),
);
items.push(...additionalItems.filter((i) => (itemId && i.id === itemId) || this.itemType === i.type));

// Check if there are no items to process first (commmon if its a single item alteration)
if (items.length === 0) return;
Expand Down

0 comments on commit 006467c

Please sign in to comment.