mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-08-05 13:33:00 +00:00
Merge pull request #101 from HabitRPG/sabe/fix2
fix(checklists): Make checklist To-Do behavior more intuitive
This commit is contained in:
commit
21ea62b918
2 changed files with 7 additions and 5 deletions
6
dist/habitrpg-shared.js
vendored
6
dist/habitrpg-shared.js
vendored
|
|
@ -12041,8 +12041,10 @@ var process=require("__browserify_process");(function() {
|
|||
return m + (i.completed ? 1 : 0);
|
||||
}), 0) / task.checklist.length;
|
||||
}
|
||||
if (task.type === 'todo') {
|
||||
nextDelta *= task.checklist.length;
|
||||
if (task.type === 'todo' && direction === 'up') {
|
||||
nextDelta *= 1 + _.reduce(task.checklist, (function(m, i) {
|
||||
return m + (i.completed ? 1 : 0);
|
||||
}), 0);
|
||||
}
|
||||
}
|
||||
if (task.type !== 'reward') {
|
||||
|
|
|
|||
|
|
@ -755,9 +755,9 @@ api.wrap = (user, main=true) ->
|
|||
# If the Daily, only dock them them a portion based on their checklist completion
|
||||
if direction is 'down' and task.type is 'daily' and options.cron
|
||||
nextDelta *= (1 - _.reduce(task.checklist,((m,i)->m+(if i.completed then 1 else 0)),0) / task.checklist.length)
|
||||
# If To-Do, point-match the TD per checklist item
|
||||
if task.type is 'todo'
|
||||
nextDelta *= task.checklist.length
|
||||
# If To-Do, point-match the TD per checklist item completed
|
||||
if task.type is 'todo' and direction is 'up'
|
||||
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
|
||||
|
|
|
|||
Loading…
Reference in a new issue