From af37b30363cfea05a2167d179ce059979dbb6e9a Mon Sep 17 00:00:00 2001 From: Alys Date: Thu, 19 May 2016 17:08:15 -0400 Subject: [PATCH] remove XP, GP when unticking a Daily with a completed checklist - fixes https://github.com/HabitRPG/habitrpg/issues/7246 --- common/script/ops/scoreTask.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/script/ops/scoreTask.js b/common/script/ops/scoreTask.js index f052b954e0..c366b84624 100644 --- a/common/script/ops/scoreTask.js +++ b/common/script/ops/scoreTask.js @@ -207,7 +207,7 @@ module.exports = function scoreTask (options = {}, req = {}) { if (!user.stats.buffs.streaks) task.streak = 0; } else { delta += _changeTaskValue(user, task, direction, times, cron); - if (direction === 'down') delta = _calculateDelta(task, direction, delta); // recalculate delta for unchecking so the gp and exp come out correctly + if (direction === 'down') delta = _calculateDelta(task, direction, cron); // recalculate delta for unchecking so the gp and exp come out correctly _addPoints(user, task, stats, direction, delta); // obviously for delta>0, but also a trick to undo accidental checkboxes _gainMP(user, _.max([1, 0.01 * user._statsComputed.maxMP]) * (direction === 'down' ? -1 : 1)); @@ -236,7 +236,7 @@ module.exports = function scoreTask (options = {}, req = {}) { } delta += _changeTaskValue(user, task, direction, times, cron); - if (direction === 'down') delta = _calculateDelta(task, direction, delta); // recalculate delta for unchecking so the gp and exp come out correctly + if (direction === 'down') delta = _calculateDelta(task, direction, cron); // recalculate delta for unchecking so the gp and exp come out correctly _addPoints(user, task, stats, direction, delta); // MP++ per checklist item in ToDo, bonus per CLI