mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2024-11-07 19:30:48 +01:00
Handle interval == 0 windups
This commit is contained in:
parent
53cd13b0ec
commit
0a3d559b39
@ -153,9 +153,13 @@ public abstract class Windup extends Deactivatable {
|
||||
|
||||
@Override
|
||||
public void activate() {
|
||||
if (interval <= 0) {
|
||||
runnable.run();
|
||||
} else {
|
||||
active = true;
|
||||
startTask();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Cancels the {@link #getTask() task}.
|
||||
@ -163,8 +167,10 @@ public abstract class Windup extends Deactivatable {
|
||||
@Override
|
||||
public void deactivate() {
|
||||
active = false;
|
||||
if (getTask() != null) {
|
||||
getTask().cancel();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Activates the sign if it is not yet active and deactivates it if it is already active.
|
||||
|
@ -102,14 +102,4 @@ public class DropSign extends Windup {
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void activate() {
|
||||
if (interval < 0) {
|
||||
active = true;
|
||||
getRunnable().run();
|
||||
} else {
|
||||
super.activate();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user