mirror of
https://github.com/array-in-a-matrix/brainwine.git
synced 2025-04-02 11:11:58 -04:00
No more 60 second default duration
This commit is contained in:
parent
114147a23b
commit
c120ab5d79
1 changed files with 2 additions and 2 deletions
|
@ -15,7 +15,7 @@ import brainwine.gameserver.util.Vector2i;
|
||||||
public class IdleBehavior extends Behavior {
|
public class IdleBehavior extends Behavior {
|
||||||
|
|
||||||
protected int delay = 60;
|
protected int delay = 60;
|
||||||
protected int duration = 60;
|
protected int duration = -1;
|
||||||
protected double random = 0.5;
|
protected double random = 0.5;
|
||||||
protected Vector2i groundOffset = new Vector2i(0, 1);
|
protected Vector2i groundOffset = new Vector2i(0, 1);
|
||||||
protected String[] animations = new String[] {"idle"};
|
protected String[] animations = new String[] {"idle"};
|
||||||
|
@ -64,7 +64,7 @@ public class IdleBehavior extends Behavior {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected long getNextUntil() {
|
protected long getNextUntil() {
|
||||||
int currentDuration = (idle ? duration : delay) * 1000;
|
int currentDuration = (idle && duration > 0 ? duration : delay) * 1000;
|
||||||
return (long)(System.currentTimeMillis() + currentDuration + currentDuration * (Math.random() * random));
|
return (long)(System.currentTimeMillis() + currentDuration + currentDuration * (Math.random() * random));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue