From e20505508ea6a30cf882c54b1e7ce1c60d72e5b5 Mon Sep 17 00:00:00 2001 From: Phinner <62483793+Phinner@users.noreply.github.com> Date: Fri, 11 Feb 2022 01:44:30 +0100 Subject: [PATCH] funni js (#6566) --- core/src/mindustry/core/Platform.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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. */