classes: replenish 10MP on cron

This commit is contained in:
Tyler Renelle 2013-12-16 11:11:47 -07:00
parent 49ba74f9bd
commit b055b2d9a4
2 changed files with 7 additions and 0 deletions

View file

@ -11838,6 +11838,10 @@ var process=require("__browserify_process");(function() {
if (user.items.lastDrop.count > 0) {
user.items.lastDrop.count = 0;
}
user.stats.mp += 10;
if (user.stats.mp > user._statsComputed.maxMP) {
user.stats.mp = user._statsComputed.maxMP;
}
if (user.preferences.sleep === true) {
return;
}

View file

@ -981,6 +981,9 @@ api.wrap = (user) ->
if user.items.lastDrop.count > 0
user.items.lastDrop.count = 0
user.stats.mp += 10
user.stats.mp = user._statsComputed.maxMP if user.stats.mp > user._statsComputed.maxMP
# User is resting at the inn. Used to be we un-checked each daily without performing calculation (see commits before fb29e35)
# but to prevent abusing the inn (http://goo.gl/GDb9x) we now do *not* calculate dailies, and simply set lastCron to today
return if user.preferences.sleep is true