make Gold=>Gem conversion cap message more accurate in terms of when to wait until - fixes https://github.com/HabitRPG/habitrpg/issues/3996

This commit is contained in:
Alice Harris 2014-11-25 05:16:36 +10:00
parent d01b4291af
commit 66aebf2e80

View file

@ -697,7 +697,7 @@ api.wrap = (user, main=true) ->
{convRate,convCap} = api.planGemLimits {convRate,convCap} = api.planGemLimits
return cb?({code:401,message:"Must subscribe to purchase gems with GP"},req) unless user.purchased?.plan?.planId return cb?({code:401,message:"Must subscribe to purchase gems with GP"},req) unless user.purchased?.plan?.planId
return cb?({code:401,message:"Not enough Gold"}) unless user.stats.gp >= convRate return cb?({code:401,message:"Not enough Gold"}) unless user.stats.gp >= convRate
return cb?({code:401,message:"You've reached the Gold=>Gem conversion cap (#{convCap}) for this month. We have this to prevent abuse / farming, please wait until the beginning of next month."}) if user.purchased.plan.gemsBought >= convCap return cb?({code:401,message:"You've reached the Gold=>Gem conversion cap (#{convCap}) for this month. We have this to prevent abuse / farming. The cap will reset within the first three days of next month."}) if user.purchased.plan.gemsBought >= convCap
user.balance += .25 user.balance += .25
user.purchased.plan.gemsBought++ user.purchased.plan.gemsBought++
user.stats.gp -= convRate user.stats.gp -= convRate