Skip to content

Commit

Permalink
[#3606] Fix issue when re-rendering NPC sheet with filters active
Browse files Browse the repository at this point in the history
  • Loading branch information
Fyorl committed Jul 19, 2024
1 parent d6fd023 commit 270904c
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions module/applications/actor/npc-sheet.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export default class ActorSheet5eNPC extends ActorSheet5e {

// Start by classifying items into groups for rendering
const maxLevelDelta = CONFIG.DND5E.maxLevel - (this.actor.system.details.level ?? 0);
let [spells, other] = context.items.reduce((arr, item) => {
const [spells, other] = context.items.reduce((arr, item) => {
const {quantity, uses, target} = item.system;
const ctx = context.itemContext[item.id] ??= {};
ctx.isStack = Number.isNumeric(quantity) && (quantity !== 1);
Expand All @@ -79,10 +79,6 @@ export default class ActorSheet5eNPC extends ActorSheet5e {
return arr;
}, [[], []]);

// Apply item filters
spells = this._filterItems(spells, this._filters.spellbook.properties);
other = this._filterItems(other, this._filters.features.properties);

// Organize Spellbook
const spellbook = this._prepareSpellbook(context, spells);

Expand Down

0 comments on commit 270904c

Please sign in to comment.