v3: fix tasks saving and selection for rebirth reroll and reset (server-only)

This commit is contained in:
Matteo Pagliazzi
2016-05-16 12:04:09 +02:00
parent ba1628427e
commit 793ca3b172
4 changed files with 42 additions and 25 deletions

View File

@@ -13,8 +13,10 @@ module.exports = function reroll (user, tasks = [], req = {}, analytics) {
user.stats.hp = 50;
_.each(tasks, function resetTaskValues (task) {
if (task.type !== 'reward') {
task.value = 0;
if (!task.challenge || !task.challenge.id || task.challenge.broken) {
if (task.type !== 'reward') {
task.value = 0;
}
}
});