From 2cd7555bbe88ede03dfd90bac96c24c33022965b Mon Sep 17 00:00:00 2001 From: Dev Date: Thu, 6 Apr 2023 15:37:35 +0100 Subject: [PATCH] Fix: Only return prices for items that exist in items.json (cherry picked from commit c0aece0a2c9a84f71d8b5dd940c3e37a9017b6ed) --- project/src/generators/RagfairOfferGenerator.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/project/src/generators/RagfairOfferGenerator.ts b/project/src/generators/RagfairOfferGenerator.ts index 947f3037..c77585fe 100644 --- a/project/src/generators/RagfairOfferGenerator.ts +++ b/project/src/generators/RagfairOfferGenerator.ts @@ -643,7 +643,11 @@ export class RagfairOfferGenerator { const fleaPrices = this.databaseServer.getTables().templates.prices; const fleaArray = Object.entries(fleaPrices).map(([tpl, price]) => ({ tpl: tpl, price: price })); - this.allowedFleaPriceItemsForBarter = fleaArray.filter(x => !this.itemHelper.isOfBaseclasses(x.tpl, this.ragfairConfig.dynamic.barter.itemTypeBlacklist)); + + // Only get item prices for items that also exist in items.json + const filteredItems = fleaArray.filter(x => this.itemHelper.getItem(x.tpl)[0]); + + this.allowedFleaPriceItemsForBarter = filteredItems.filter(x => !this.itemHelper.isOfBaseclasses(x.tpl, this.ragfairConfig.dynamic.barter.itemTypeBlacklist)); } return this.allowedFleaPriceItemsForBarter;