replace _.times with for loop to allow break
This commit is contained in:
+13
-15
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user