diff --git a/common/script/index.coffee b/common/script/index.coffee index a146923abf..aeab2f76e8 100644 --- a/common/script/index.coffee +++ b/common/script/index.coffee @@ -1749,22 +1749,20 @@ api.wrap = (user, main=true) -> dailyChecked += 1 else # dailys repeat, so need to calculate how many they've missed according to their own schedule - console.log("task: " + task.text) # XXX Alys to remove these + console.log("---- task: " + task.text) # XXX Alys to remove these scheduleMisses = 0 - keepGoing = true # XXX Alys to improve how we break out of _.times - _.times daysMissed, (n) -> - if keepGoing - console.log("n: " + n) - thatDay = moment(now).subtract({days: n + 1}) - if api.shouldDo(thatDay.toDate(), task, user.preferences) - console.log("damage") - scheduleMisses++ - if user.stats.buffs.stealth - user.stats.buffs.stealth-- - EvadeTask++ - if multiDaysCountAsOneDay - console.log("end") - keepGoing = false + for n in [0...daysMissed] + console.log("n: " + n) + thatDay = moment(now).subtract({days: n + 1}) + if api.shouldDo(thatDay.toDate(), task, user.preferences) + console.log("damage") + scheduleMisses++ + if user.stats.buffs.stealth + user.stats.buffs.stealth-- + EvadeTask++ + if multiDaysCountAsOneDay + console.log("end") + break if scheduleMisses > EvadeTask perfect = false