From ce2b06be6caa03e36fa6025ba6659ca71343c4d8 Mon Sep 17 00:00:00 2001 From: yusshu Date: Sun, 3 Sep 2023 20:41:44 -0500 Subject: [PATCH] fix(engine): do not ignore globalBindings, remove overriden variable bindings --- src/main/java/team/unnamed/molang/MoLangEngine.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/team/unnamed/molang/MoLangEngine.java b/src/main/java/team/unnamed/molang/MoLangEngine.java index 92d0b9f..cf3d572 100644 --- a/src/main/java/team/unnamed/molang/MoLangEngine.java +++ b/src/main/java/team/unnamed/molang/MoLangEngine.java @@ -20,7 +20,6 @@ public class MoLangEngine { private final MoLangParser parser = new StandardMoLangParser(); - private final StorageBinding variable = new StorageBinding(); private final Map globalBindings; @@ -35,7 +34,7 @@ public Object eval(String script) throws ScriptException { public Object eval(Reader reader) throws ScriptException { try { Bindings bindings = new SimpleBindings(); - bindings.put("variable", variable); + bindings.putAll(globalBindings); // temporal storage StorageBinding temp = new StorageBinding();