Check food is Saddle before selling

This commit is contained in:
Gurkirpal
2019-09-11 19:32:51 +05:30
parent 9709b92d33
commit 201b4551a3

View File

@@ -43,8 +43,8 @@ module.exports = function sell (user, req = {}) {
throw new NotFound(i18n.t('userItemsNotEnough', {type}, req.language));
}
if (content[type][key].sellWarningNote) {
throw new NotAuthorized(content[type][key].sellWarningNote());
if (type === 'food' && key === 'Saddle') {
throw new NotAuthorized(content[type][key].sellWarningNote(req.language));
}
user.items[type][key] -= amount;