mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 22:27:26 +01:00
Include seasonal gear in Market class lists (#9739)
* fix(shops): include seasonal gear in Market class lists * fix(market): display non-seasonal broken special items Also fixes a bug where if a current seasonal item was broken, it would show up twice.
This commit is contained in:
@@ -155,7 +155,16 @@ shops.getMarketGearCategories = function getMarketGear (user, language) {
|
||||
text: getClassName(classType, language),
|
||||
};
|
||||
|
||||
let result = filter(content.gear.flat, ['klass', classType]);
|
||||
let result = filter(content.gear.flat, function findClassGear (gearItem) {
|
||||
if (gearItem.klass === classType) return true;
|
||||
let classShift = {
|
||||
items: user.items,
|
||||
stats: {
|
||||
class: classType,
|
||||
},
|
||||
};
|
||||
if (gearItem.specialClass === classType && user.items.gear.owned[gearItem.key] !== false) return gearItem.canOwn(classShift);
|
||||
});
|
||||
|
||||
category.items = map(result, (e) => {
|
||||
let newItem = getItemInfo(user, 'marketGear', e, officialPinnedItems);
|
||||
@@ -184,9 +193,7 @@ shops.getMarketGearCategories = function getMarketGear (user, language) {
|
||||
};
|
||||
|
||||
let falseGear = filter(content.gear.flat, (gear) => {
|
||||
return user.items.gear.owned[gear.key] === false &&
|
||||
gear.klass !== user.stats.class &&
|
||||
gear.klass !== 'special';
|
||||
return user.items.gear.owned[gear.key] === false && (gear.klass === 'special' && !gear.specialClass || gear.key.indexOf('mystery') !== -1);
|
||||
});
|
||||
|
||||
nonClassCategory.items = map(falseGear, (e) => {
|
||||
|
||||
Reference in New Issue
Block a user