make objective reset not permanent

This commit is contained in:
Milos Kozak 2019-10-08 08:27:33 +02:00
parent 532a7e3741
commit 4b8395a373

View file

@ -37,9 +37,9 @@ public abstract class Objective {
this.gate = gate; this.gate = gate;
startedOn = SP.getLong("Objectives_" + spName + "_started", 0L); startedOn = SP.getLong("Objectives_" + spName + "_started", 0L);
accomplishedOn = SP.getLong("Objectives_" + spName + "_accomplished", 0L); accomplishedOn = SP.getLong("Objectives_" + spName + "_accomplished", 0L);
if ((accomplishedOn - DateUtil.now()) > T.days(1).msecs()) { // more than 1 day in the future if ((accomplishedOn - DateUtil.now()) > T.hours(3).msecs() || (startedOn - DateUtil.now()) > T.hours(3).msecs()) { // more than 3 hours in the future
setStartedOn(0); startedOn = 0;
setAccomplishedOn(0); accomplishedOn = 0;
} }
setupTasks(tasks); setupTasks(tasks);
for (Task task : tasks) task.objective = this; for (Task task : tasks) task.objective = this;