From 2f673d12b96e4442e12404a53d0dfc04f464c7ed Mon Sep 17 00:00:00 2001 From: Dev Date: Mon, 5 Feb 2024 11:38:04 +0000 Subject: [PATCH] Improve weapon/equipment item purchase filtering --- project/src/helpers/RagfairOfferHelper.ts | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/project/src/helpers/RagfairOfferHelper.ts b/project/src/helpers/RagfairOfferHelper.ts index 98fbfcf7..65126d73 100644 --- a/project/src/helpers/RagfairOfferHelper.ts +++ b/project/src/helpers/RagfairOfferHelper.ts @@ -675,19 +675,17 @@ export class RagfairOfferHelper } // Performing a required search and offer doesn't have requirement for item - if (searchRequest.neededSearchId && !offer.requirements.some((x) => x._tpl === searchRequest.neededSearchId)) + if ( + searchRequest.neededSearchId + && !offer.requirements.some((requirement) => requirement._tpl === searchRequest.neededSearchId) + ) { return false; } - // Filter out presets when search request has multiple buildItems - // Assuming 1 build item = single item e.g. gun - if ( - searchRequest.buildCount && this.presetHelper.hasPreset(offerRootItem._tpl) - && Object.keys(searchRequest.buildItems).length > 1 - ) + // weapon/equipment search + offer is preset + if (searchRequest.buildCount && this.presetHelper.hasPreset(offerRootItem._tpl)) { - // Don't include preset offer return false; }