diff --git a/common/script/index.coffee b/common/script/index.coffee index f5d49a1df1..10e3acc352 100644 --- a/common/script/index.coffee +++ b/common/script/index.coffee @@ -750,7 +750,7 @@ api.wrap = (user, main=true) -> item = content[type][key] price = item.value / 4 return cb?({code:404,message:":key not found for Content.#{type}"},req) unless item - return cb?({code:401, message: i18n.t('notEnoughGems', req.language)}) if user.balance < price + return cb?({code:401, message: i18n.t('notEnoughGems', req.language)}) if (user.balance < price) or !user.balance user.balance -= price if type is 'gear' then user.items.gear.owned[key] = true else