From 0162ed7d92952b3682b0c80c644e18acc7d44da8 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Wed, 2 Feb 2022 11:45:33 +0100 Subject: [PATCH] Update Greater and Less Signed-off-by: yoyosource --- .../bausystem/features/script/command/logic/Greater.java | 6 +++--- .../bausystem/features/script/command/logic/Less.java | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/script/command/logic/Greater.java b/BauSystem_Main/src/de/steamwar/bausystem/features/script/command/logic/Greater.java index b1ce35d9..8a30d5ab 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/script/command/logic/Greater.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/script/command/logic/Greater.java @@ -44,16 +44,16 @@ public class Greater implements SpecialCommand { Value v1 = scriptExecutor.getOrItselfValue(command[command.length - 2]); Value v2 = scriptExecutor.getOrItselfValue(command[command.length - 1]); - if (!(v1 instanceof Value.LongValue)) { + if (!(v1 instanceof Value.LongValue) && !(v1 instanceof Value.DoubleValue)) { BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_NUMBER_COMPARE", scriptExecutor.getPlayer()); return true; } - if (!(v2 instanceof Value.LongValue)) { + if (!(v2 instanceof Value.LongValue) && !(v2 instanceof Value.DoubleValue)) { BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_NUMBER_COMPARE", scriptExecutor.getPlayer()); return true; } Value result; - if (v1.asLong() > v2.asLong()) { + if (v1.asDouble() > v2.asDouble()) { result = new Value.BooleanValue(true); } else { result = new Value.BooleanValue(false); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/script/command/logic/Less.java b/BauSystem_Main/src/de/steamwar/bausystem/features/script/command/logic/Less.java index e6dbe646..711144a5 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/script/command/logic/Less.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/script/command/logic/Less.java @@ -44,16 +44,16 @@ public class Less implements SpecialCommand { Value v1 = scriptExecutor.getOrItselfValue(command[command.length - 2]); Value v2 = scriptExecutor.getOrItselfValue(command[command.length - 1]); - if (!(v1 instanceof Value.LongValue)) { + if (!(v1 instanceof Value.LongValue) && !(v1 instanceof Value.DoubleValue)) { BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_NUMBER_COMPARE", scriptExecutor.getPlayer()); return true; } - if (!(v2 instanceof Value.LongValue)) { + if (!(v2 instanceof Value.LongValue) && !(v2 instanceof Value.DoubleValue)) { BauSystem.MESSAGE.send("SCRIPT_COMMAND_ERROR_NUMBER_COMPARE", scriptExecutor.getPlayer()); return true; } Value result; - if (v1.asLong() < v2.asLong()) { + if (v1.asDouble() < v2.asDouble()) { result = new Value.BooleanValue(true); } else { result = new Value.BooleanValue(false);