diff --git a/src/api b/src/api index 8980850d7..05c95c96b 160000 --- a/src/api +++ b/src/api @@ -1 +1 @@ -Subproject commit 8980850d7c6da1adac72818cc9eb2e87657467d4 +Subproject commit 05c95c96b9872cfec53f035418dc02577a1629ba diff --git a/src/main/java/noppes/npcs/scripted/ScriptedActionManager.java b/src/main/java/noppes/npcs/scripted/ScriptedActionManager.java index ab01c5e82..49b374f4d 100644 --- a/src/main/java/noppes/npcs/scripted/ScriptedActionManager.java +++ b/src/main/java/noppes/npcs/scripted/ScriptedActionManager.java @@ -193,7 +193,7 @@ public class ScriptedActionManager implements IActionManager { protected final String name; protected int startAfterTicks; protected int count = 0; - protected int duration = 0; + protected int duration = -1; protected int maxDuration = -1; protected int updateEveryXTick = 5; protected final Consumer task; @@ -237,7 +237,7 @@ public class ScriptedActionManager implements IActionManager { return; } - if (getDuration() >= getMaxDuration()) + if (duration != -1 && duration >= maxDuration) markDone(); // only run on our update tick if (ticksExisted % updateEveryXTick == 0) { @@ -429,7 +429,7 @@ public class ScriptedActionManager implements IActionManager { Supplier predicate, Consumer task, int maxChecks) { - super(name, Integer.MAX_VALUE, 0, task); + super(name, 0, task); this.predicate = predicate; this.updateEveryXTick = checkIntervalTicks; this.maxChecks = maxChecks;