mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-15 21:57:22 +01:00
Check food is Saddle before selling
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user