Skip to content

Commit

Permalink
fix(engine): do not ignore globalBindings, remove overriden variable …
Browse files Browse the repository at this point in the history
…bindings
  • Loading branch information
yusshu committed Sep 4, 2023
1 parent ffb5b02 commit ce2b06b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/main/java/team/unnamed/molang/MoLangEngine.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
public class MoLangEngine {

private final MoLangParser parser = new StandardMoLangParser();
private final StorageBinding variable = new StorageBinding();

private final Map<String, Object> globalBindings;

Expand All @@ -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();
Expand Down

0 comments on commit ce2b06b

Please sign in to comment.