From fd601dc9ce610b91110b1dbbe1227c0fa46ac7ea Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sat, 13 Nov 2021 16:35:38 +0100 Subject: [PATCH] Fix CustomScript Signed-off-by: yoyosource --- .../bausystem/features/script/CustomScript.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/script/CustomScript.java b/BauSystem_Main/src/de/steamwar/bausystem/features/script/CustomScript.java index deb73c3e..6eba26d3 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/script/CustomScript.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/script/CustomScript.java @@ -204,21 +204,24 @@ public class CustomScript { if (menuCommand.args.length != args.length) { return false; } + if (!args[0].equals(menuCommand.args[0])) { + return false; + } for (int i = 0; i < args.length; i++) { if (i == 0) continue; String s1 = args[i]; String s2 = menuCommand.args[i]; - if (s1.equals(s2)) { - return true; + if (!s1.equals(s2)) { + return false; } - if (s1.startsWith("<") && s1.endsWith(">") && s2.startsWith("<") && s2.endsWith(">")) { - return true; + if (!(s1.startsWith("<") && s1.endsWith(">") && s2.startsWith("<") && s2.endsWith(">"))) { + return false; } - if (s1.startsWith("(<") && s1.endsWith(">)") && s2.startsWith("(<") && s2.endsWith(">)")) { - return true; + if (!(s1.startsWith("(<") && s1.endsWith(">)") && s2.startsWith("(<") && s2.endsWith(">)"))) { + return false; } } - return false; + return true; } @Override