From 70394ea0b99f4ece13bb8218ea9f8bc7f55c6057 Mon Sep 17 00:00:00 2001 From: Sabe Jones Date: Sun, 19 Jan 2014 09:36:23 -0600 Subject: [PATCH] fix(autoAllocate): don't detrain stats on ripening To-Dos Previously, on cron, the reddening of To-Dos would subtract from the stat training for task-based auto-allocation. This had a tendency to cause users with lots of active tasks to get backward stat allocations on levelup. Now the "down" direction for To-Dos is not counted for attribute training. (Missed Dailies will still detrain.) Fixes HabitRPG/habitrpg/#2247 --- dist/habitrpg-shared.js | 2 +- script/index.coffee | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/habitrpg-shared.js b/dist/habitrpg-shared.js index ac401e846e..92cbe8d6a1 100644 --- a/dist/habitrpg-shared.js +++ b/dist/habitrpg-shared.js @@ -12046,7 +12046,7 @@ var process=require("__browserify_process");(function() { } } if (task.type !== 'reward') { - if (user.preferences.automaticAllocation === true && user.preferences.allocationMode === 'taskbased') { + if (user.preferences.automaticAllocation === true && user.preferences.allocationMode === 'taskbased' && !(task.type === 'todo' && direction === 'down')) { user.stats.training[task.attribute] += nextDelta; } adjustAmt = nextDelta; diff --git a/script/index.coffee b/script/index.coffee index 9e11bd756e..1ab670ddb0 100644 --- a/script/index.coffee +++ b/script/index.coffee @@ -760,7 +760,7 @@ api.wrap = (user, main=true) -> nextDelta *= task.checklist.length unless task.type is 'reward' - if (user.preferences.automaticAllocation is true and user.preferences.allocationMode is 'taskbased') then user.stats.training[task.attribute] += nextDelta + if (user.preferences.automaticAllocation is true and user.preferences.allocationMode is 'taskbased' and !(task.type is 'todo' and direction is 'down')) then user.stats.training[task.attribute] += nextDelta adjustAmt = nextDelta # ===== STRENGTH ===== # (Only for up-scoring, ignore up-onlies and rewards)