From b8a27294fce996108dccdf4364b4a281a0d1121c Mon Sep 17 00:00:00 2001 From: yoyosource Date: Tue, 4 Apr 2023 18:33:36 +0200 Subject: [PATCH] Possibly fix ScriptExecutor Signed-off-by: yoyosource --- .../features/script/ScriptExecutor.java | 24 ------------------- 1 file changed, 24 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/script/ScriptExecutor.java b/BauSystem_Main/src/de/steamwar/bausystem/features/script/ScriptExecutor.java index 785c042b..25b29147 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/script/ScriptExecutor.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/script/ScriptExecutor.java @@ -191,30 +191,6 @@ public final class ScriptExecutor { private String[] replaceExpressions(String s) { s = s.replaceAll(" +", " "); - // TODO: Remove this code as the Expression System below will replace it! - Set variables = new HashSet<>(localVariables.allVariables()); - variables.addAll(Constants.allVariables()); - variables.addAll(globalVariables.allVariables()); - - for (int i = 0; i < 3; i++) { - for (String variable : variables) { - s = s.replace("<" + variable + ">", getValue(variable)); - s = s.replace("<" + variable + ".type>", getOrItselfValue(variable).type()); - } - for (String constVariable : Constants.allVariables()) { - s = s.replace("", getConstant(constVariable)); - s = s.replace("", Constants.getConstant(constVariable, player).type()); - } - for (String localVariable : localVariables.allVariables()) { - s = s.replace("", getLocal(localVariable)); - s = s.replace("", getLocalVariables().getValue(localVariable).type()); - } - for (String globalVariable : globalVariables.allVariables()) { - s = s.replace("", getGlobal(globalVariable)); - s = s.replace("", globalVariables.getValue(globalVariable).type()); - } - } - StringBuilder result = new StringBuilder(); int depth = 0; StringBuilder st = new StringBuilder();