minor improvements to cron code for clarity; fix inaccurate comments; add TODOs for rest-in-inn actions

This commit is contained in:
Alys
2016-05-14 13:26:26 +10:00
parent 1fd7df7521
commit 6acaef50e6
2 changed files with 15 additions and 15 deletions

View File

@@ -87,7 +87,6 @@ function _gainMP (user, val) {
if (user.stats.mp >= user._statsComputed.maxMP) user.stats.mp = user._statsComputed.maxMP;
if (user.stats.mp < 0) {
user.stats.mp = 0;
return user.stats.mp;
}
}
@@ -181,10 +180,9 @@ module.exports = function scoreTask (options = {}, req = {}) {
// the API consumer, then cleared afterwards
user._tmp = {};
// If they're trying to purhcase a too-expensive reward, don't allow them to do that.
// If they're trying to purchase a too-expensive reward, don't allow them to do that.
if (task.value > user.stats.gp && task.type === 'reward') throw new NotAuthorized(i18n.t('messageNotEnoughGold', req.language));
// ===== starting to actually do stuff, most of above was definitions =====
if (task.type === 'habit') {
delta += _changeTaskValue(user, task, direction, times, cron);