mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-04-14 19:56:23 +00:00
* for locking items, special overrides available * fix(market): allow purchase of broken item Co-authored-by: Megan Shepherd <meg.d.shep@gmail.com> Co-authored-by: SabreCat <sabe@habitica.com>
This commit is contained in:
parent
1a74d2b3b0
commit
5bc544c481
2 changed files with 7 additions and 7 deletions
|
|
@ -108,12 +108,6 @@ shops.checkMarketGearLocked = function checkMarketGearLocked (user, items) {
|
|||
gear.locked = true;
|
||||
}
|
||||
|
||||
if (Boolean(gear.specialClass) && Boolean(gear.set)) {
|
||||
const currentSet = gear.set === seasonalShopConfig.pinnedSets[gear.specialClass];
|
||||
|
||||
gear.locked = currentSet && user.stats.class !== gear.specialClass;
|
||||
}
|
||||
|
||||
if (gear.canOwn) {
|
||||
gear.locked = !gear.canOwn(user);
|
||||
}
|
||||
|
|
@ -124,6 +118,12 @@ shops.checkMarketGearLocked = function checkMarketGearLocked (user, items) {
|
|||
gear.locked = true;
|
||||
}
|
||||
|
||||
if (Boolean(gear.specialClass) && Boolean(gear.set)) {
|
||||
const currentSet = gear.set === seasonalShopConfig.pinnedSets[gear.specialClass];
|
||||
|
||||
gear.locked = currentSet && user.stats.class !== gear.specialClass;
|
||||
}
|
||||
|
||||
gear.owned = itemOwned;
|
||||
|
||||
// @TODO: I'm not sure what the logic for locking is supposed to be
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ export class BuyMarketGearOperation extends AbstractGoldItemOperation { // eslin
|
|||
const checkSpecialClass = item.klass === 'special' && item.specialClass && item.specialClass !== user.stats.class;
|
||||
|
||||
// check for different class gear
|
||||
if (checkKlass || checkSpecialClass) {
|
||||
if ((checkKlass || checkSpecialClass) && user.items.gear.owned[item.key] !== false) {
|
||||
throw new NotAuthorized(this.i18n('cannotBuyItem'));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue