FIx equipment preset flea seach not showing any offers

This commit is contained in:
Dev 2024-02-14 11:58:17 +00:00
parent 68f2bb8495
commit 882d1b6ee5
2 changed files with 8 additions and 3 deletions

View File

@ -86,6 +86,8 @@ export class RagfairController
public getOffers(sessionID: string, searchRequest: ISearchRequestData): IGetOffersResult public getOffers(sessionID: string, searchRequest: ISearchRequestData): IGetOffersResult
{ {
const pmcProfile = this.profileHelper.getPmcProfile(sessionID);
const itemsToAdd = this.ragfairHelper.filterCategories(sessionID, searchRequest); const itemsToAdd = this.ragfairHelper.filterCategories(sessionID, searchRequest);
const traderAssorts = this.ragfairHelper.getDisplayableAssorts(sessionID); const traderAssorts = this.ragfairHelper.getDisplayableAssorts(sessionID);
const result: IGetOffersResult = { const result: IGetOffersResult = {
@ -94,10 +96,9 @@ export class RagfairController
selectedCategory: searchRequest.handbookId, selectedCategory: searchRequest.handbookId,
}; };
const pmcProfile = this.profileHelper.getPmcProfile(sessionID);
result.offers = this.getOffersForSearchType(searchRequest, itemsToAdd, traderAssorts, pmcProfile); result.offers = this.getOffersForSearchType(searchRequest, itemsToAdd, traderAssorts, pmcProfile);
// Client requested a category refresh
if (searchRequest.updateOfferCount) if (searchRequest.updateOfferCount)
{ {
result.categories = this.getSpecificCategories(pmcProfile, searchRequest, result.offers); result.categories = this.getSpecificCategories(pmcProfile, searchRequest, result.offers);

View File

@ -702,7 +702,11 @@ export class RagfairOfferHelper
} }
// weapon/equipment search + offer is preset // weapon/equipment search + offer is preset
if (searchRequest.buildCount && this.presetHelper.hasPreset(offerRootItem._tpl)) if (
Object.keys(searchRequest.buildItems).length === 0 // Prevent equipment loadout searches filtering out presets
&& searchRequest.buildCount
&& this.presetHelper.hasPreset(offerRootItem._tpl)
)
{ {
return false; return false;
} }