Improve weapon/equipment item purchase filtering
This commit is contained in:
parent
0f6b34605b
commit
2f673d12b9
@ -675,19 +675,17 @@ export class RagfairOfferHelper
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Performing a required search and offer doesn't have requirement for item
|
// 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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Filter out presets when search request has multiple buildItems
|
// weapon/equipment search + offer is preset
|
||||||
// Assuming 1 build item = single item e.g. gun
|
if (searchRequest.buildCount && this.presetHelper.hasPreset(offerRootItem._tpl))
|
||||||
if (
|
|
||||||
searchRequest.buildCount && this.presetHelper.hasPreset(offerRootItem._tpl)
|
|
||||||
&& Object.keys(searchRequest.buildItems).length > 1
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
// Don't include preset offer
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user