Merge remote-tracking branch 'upstream/develop' into quest-refactors
This commit is contained in:
@@ -8,6 +8,8 @@ import {
|
||||
NotFound,
|
||||
} from '../../libs/errors';
|
||||
import errorMessage from '../../libs/errorMessage';
|
||||
import { removeItemByPath } from '../pinnedGearUtils';
|
||||
import getItemInfo from '../../libs/getItemInfo';
|
||||
|
||||
export default function buyMysterySet (user, req = {}, analytics) {
|
||||
const key = get(req, 'params.key');
|
||||
@@ -28,6 +30,9 @@ export default function buyMysterySet (user, req = {}, analytics) {
|
||||
user.items.gear.owned[item.key] = true;
|
||||
});
|
||||
|
||||
const itemInfo = getItemInfo(user, 'mystery_set', mysterySet);
|
||||
removeItemByPath(user, itemInfo.path);
|
||||
|
||||
if (analytics) {
|
||||
analytics.track('buy', {
|
||||
uuid: user._id,
|
||||
|
||||
@@ -71,6 +71,11 @@ export default function purchaseHourglass (user, req = {}, analytics, quantity =
|
||||
[key]: 5,
|
||||
};
|
||||
if (user.markModified) user.markModified('items.pets');
|
||||
const itemInfo = getItemInfo(user, 'timeTravelersStable', {
|
||||
key,
|
||||
type,
|
||||
});
|
||||
removeItemByPath(user, itemInfo.path);
|
||||
}
|
||||
|
||||
if (type === 'mounts') {
|
||||
@@ -79,6 +84,11 @@ export default function purchaseHourglass (user, req = {}, analytics, quantity =
|
||||
[key]: true,
|
||||
};
|
||||
if (user.markModified) user.markModified('items.mounts');
|
||||
const itemInfo = getItemInfo(user, 'timeTravelersStable', {
|
||||
key,
|
||||
type,
|
||||
});
|
||||
removeItemByPath(user, itemInfo.path);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user