Remove user wrapping (#9960)

* remove user wrapping, fixes #9146

* update tests

* fix tests
This commit is contained in:
Matteo Pagliazzi
2018-02-09 13:46:55 +01:00
committed by GitHub
parent 8e24b0578e
commit f947d3562b
14 changed files with 59 additions and 190 deletions

View File

@@ -428,8 +428,8 @@ export function cron (options = {}) {
// Add 10 MP, or 10% of max MP if that'd be more. Perform this after Perfect Day for maximum benefit
// Adjust for fraction of dailies completed
if (dailyDueUnchecked === 0 && dailyChecked === 0) dailyChecked = 1;
user.stats.mp += _.max([10, 0.1 * user._statsComputed.maxMP]) * dailyChecked / (dailyDueUnchecked + dailyChecked);
if (user.stats.mp > user._statsComputed.maxMP) user.stats.mp = user._statsComputed.maxMP;
user.stats.mp += _.max([10, 0.1 * common.statsComputed(user).maxMP]) * dailyChecked / (dailyDueUnchecked + dailyChecked);
if (user.stats.mp > common.statsComputed(user).maxMP) user.stats.mp = common.statsComputed(user).maxMP;
// After all is said and done, progress up user's effect on quest, return those values & reset the user's
let progress = user.party.quest.progress;