Ensured damage was only done for dailies that were due yesterday

This commit is contained in:
Keith Holliday
2017-06-27 22:01:01 -06:00
parent ca8541e8c4
commit 8299982484
2 changed files with 24 additions and 1 deletions

View File

@@ -261,6 +261,10 @@ export function cron (options = {}) {
let EvadeTask = 0;
let scheduleMisses = daysMissed;
// Only check one day back
let dailiesDaysMissed = daysMissed;
if (dailiesDaysMissed > 1) dailiesDaysMissed = 1;
if (completed) {
dailyChecked += 1;
if (!atLeastOneDailyDue) { // only bother checking until the first thing is found
@@ -271,7 +275,7 @@ export function cron (options = {}) {
// dailys repeat, so need to calculate how many they've missed according to their own schedule
scheduleMisses = 0;
for (let i = 0; i < daysMissed; i++) {
for (let i = 0; i < dailiesDaysMissed; i++) {
let thatDay = moment(now).subtract({days: i + 1});
if (shouldDo(thatDay.toDate(), task, user.preferences)) {