Fix quest premium hatching potions in market

This commit is contained in:
Phillip Thelen
2024-05-22 12:21:51 +02:00
parent 1f5de1ab42
commit 2303d5de32
2 changed files with 23 additions and 1 deletions

View File

@@ -75,7 +75,12 @@ shops.getMarketCategories = function getMarket (user, language) {
premiumHatchingPotionsCategory.items = sortBy(values(content.hatchingPotions)
.filter(hp => hp.limited
&& (matchers.match(hp.key) || (hp.questPotion === true && hp.canBuy(user))))
.map(premiumHatchingPotion => getItemInfo(user, 'premiumHatchingPotion', premiumHatchingPotion, officialPinnedItems, language, matchers)), 'key');
.map(premiumHatchingPotion => {
if (premiumHatchingPotion.questPotion) {
return getItemInfo(user, 'premiumHatchingPotion', premiumHatchingPotion, officialPinnedItems, language);
}
return getItemInfo(user, 'premiumHatchingPotion', premiumHatchingPotion, officialPinnedItems, language, matchers);
}), 'key');
if (premiumHatchingPotionsCategory.items.length > 0) {
categories.push(premiumHatchingPotionsCategory);
}