Handle interval == 0 windups

This commit is contained in:
Daniel Saukel 2020-03-19 17:06:23 +01:00
parent 53cd13b0ec
commit 0a3d559b39
2 changed files with 9 additions and 13 deletions

View File

@ -153,8 +153,12 @@ public abstract class Windup extends Deactivatable {
@Override
public void activate() {
active = true;
startTask();
if (interval <= 0) {
runnable.run();
} else {
active = true;
startTask();
}
}
/**
@ -163,7 +167,9 @@ public abstract class Windup extends Deactivatable {
@Override
public void deactivate() {
active = false;
getTask().cancel();
if (getTask() != null) {
getTask().cancel();
}
}
/**

View File

@ -102,14 +102,4 @@ public class DropSign extends Windup {
});
}
@Override
public void activate() {
if (interval < 0) {
active = true;
getRunnable().run();
} else {
super.activate();
}
}
}