Merge pull request #100 from HabitRPG/sabe/fix

fix(calculateDelta): don't detrain stats on ripening To-Dos
This commit is contained in:
Tyler Renelle 2014-01-19 15:18:05 -08:00
commit 77b2e5400f
2 changed files with 2 additions and 2 deletions

View file

@ -12048,7 +12048,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;

View file

@ -760,7 +760,7 @@ api.wrap = (user, main=true) ->
nextDelta *= (1 + _.reduce(task.checklist,((m,i)->m+(if i.completed then 1 else 0)),0))
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)