diff --git a/core/src/mindustry/logic/LExecutor.java b/core/src/mindustry/logic/LExecutor.java index 3b201e4809..dc5faff849 100644 --- a/core/src/mindustry/logic/LExecutor.java +++ b/core/src/mindustry/logic/LExecutor.java @@ -42,7 +42,8 @@ public class LExecutor{ vars[varTime].numval = Time.millis(); //reset to start - if(vars[varCounter].numval >= instructions.length) vars[varCounter].numval = 0; + if(vars[varCounter].numval >= instructions.length + || vars[varCounter].numval < 0) vars[varCounter].numval = 0; if(vars[varCounter].numval < instructions.length){ instructions[(int)(vars[varCounter].numval++)].run(this);