mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2024-11-25 03:55:22 +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
|
@Override
|
||||||
public void activate() {
|
public void activate() {
|
||||||
|
if (interval <= 0) {
|
||||||
|
runnable.run();
|
||||||
|
} else {
|
||||||
active = true;
|
active = true;
|
||||||
startTask();
|
startTask();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cancels the {@link #getTask() task}.
|
* Cancels the {@link #getTask() task}.
|
||||||
@ -163,8 +167,10 @@ public abstract class Windup extends Deactivatable {
|
|||||||
@Override
|
@Override
|
||||||
public void deactivate() {
|
public void deactivate() {
|
||||||
active = false;
|
active = false;
|
||||||
|
if (getTask() != null) {
|
||||||
getTask().cancel();
|
getTask().cancel();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Activates the sign if it is not yet active and deactivates it if it is already active.
|
* 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