bug fix to todos v cron

This commit is contained in:
Tyler Renelle 2013-05-23 17:33:04 +01:00
parent a8ab98f99a
commit f0f68ce5d1

View file

@ -65,8 +65,7 @@ obj.hpModifier = (value, armorDef, helmDef, shieldDef, level, priority = '!') ->
obj.gpModifier = (value, modifier, priority = '!', streak, user) ->
val = value * modifier * obj.priorityValue(priority)
if streak and user
streakBonus = streak / 100 + 1
# eg, 1-day streak is 1.1, 2-day is 1.2, etc
streakBonus = streak / 100 + 1 # eg, 1-day streak is 1.1, 2-day is 1.2, etc
afterStreak = val * streakBonus
(user._tmp?={}).streakBonus = afterStreak - val if (val > 0) # keep this on-hand for later, so we can notify streak-bonus
return afterStreak
@ -224,7 +223,7 @@ obj.score = (user, task, direction, options={}) ->
paths["tasks.#{task.id}.streak"] = true
when 'todo'
if cron? #cron
if cron
calculateDelta()
#don't touch stats on cron
else