diff --git a/core/src/mindustry/core/Platform.java b/core/src/mindustry/core/Platform.java index cf115e3b40..60d938f084 100644 --- a/core/src/mindustry/core/Platform.java +++ b/core/src/mindustry/core/Platform.java @@ -79,9 +79,10 @@ public interface Platform{ } default Context getScriptContext(){ - Context c = Context.enter(); - c.setOptimizationLevel(9); - return c; + Context context = Context.getCurrentContext(); + if(context == null) context = Context.enter(); + context.setOptimizationLevel(9); + return context; } /** Update discord RPC. */