Skip to content

Commit

Permalink
remove duplicates when searching for money items
Browse files Browse the repository at this point in the history
  • Loading branch information
moo-man committed Dec 27, 2023
1 parent 5387bce commit 5edab67
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/system/utility-wfrp4e.js
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,7 @@ export default class WFRP_Utility {

let money = items.filter(t => Object.values(game.wfrp4e.config.moneyNames).map(n => n.toLowerCase()).includes(t.name.toLowerCase()))

moneyItems = moneyItems.concat(money)
moneyItems = moneyItems.concat(money.filter(m => !moneyItems.find(i => i.name.toLowerCase() == m.name.toLowerCase()))) // Remove duplicates
}
WFRP_Utility.log("Found Money Items: ", undefined, moneyItems)
return moneyItems
Expand Down

0 comments on commit 5edab67

Please sign in to comment.