[WIP] Make saddles not sellable

This commit is contained in:
Gurkirpal
2019-09-04 03:49:14 +05:30
parent 0fdfc4081e
commit c39f53c224

View File

@@ -43,6 +43,10 @@ module.exports = function sell (user, req = {}) {
throw new NotFound(i18n.t('userItemsNotEnough', {type}, req.language)); throw new NotFound(i18n.t('userItemsNotEnough', {type}, req.language));
} }
if (content[type][key].sellWarningNote) {
throw new NotAuthorized(i18n.t('positiveAmountRequired', req.language));
}
user.items[type][key] -= amount; user.items[type][key] -= amount;
if (user.markModified) user.markModified(`items.${type}`); if (user.markModified) user.markModified(`items.${type}`);