Skip to content

Commit 73fd92a

Browse files
committed
Fix script disabling
1 parent 3ba1ea7 commit 73fd92a

File tree

1 file changed

+6
-0
lines changed
  • src/main/java/io/github/techstreet/dfscript/script/execution

1 file changed

+6
-0
lines changed

src/main/java/io/github/techstreet/dfscript/script/execution/ScriptTask.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ public class ScriptTask {
99
private final ScriptPosStack stack;
1010
private final Event event;
1111
private boolean running;
12+
private final Script script;
1213
private final ScriptContext context;
1314

1415
public ScriptTask(ScriptPosStack stack, Event event, Script script) {
1516
this.stack = stack;
1617
this.event = event;
18+
this.script = script;
1719
this.context = script.getContext();
1820
running = true;
1921
}
@@ -31,6 +33,10 @@ public void stop() {
3133
}
3234

3335
public void run() {
36+
if (script.disabled()) { // don't run the code if it's disabled obviously
37+
return;
38+
}
39+
3440
running = true;
3541
while(true) {
3642
if(!running) break;

0 commit comments

Comments
 (0)