From 5edab67394e6a006800b702a587af647ff8babae Mon Sep 17 00:00:00 2001 From: Russell Date: Wed, 27 Dec 2023 14:06:07 -0600 Subject: [PATCH] remove duplicates when searching for money items --- modules/system/utility-wfrp4e.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/system/utility-wfrp4e.js b/modules/system/utility-wfrp4e.js index eed3c9a8e..2d902302f 100644 --- a/modules/system/utility-wfrp4e.js +++ b/modules/system/utility-wfrp4e.js @@ -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