From 672acff7423089eba36adfc07b934aee17571f86 Mon Sep 17 00:00:00 2001 From: Timo Schwarzer Date: Sun, 11 Aug 2024 17:21:49 +0200 Subject: [PATCH] Fix CompareEqual instruction --- projects/Randomizer/seed/instructions.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/projects/Randomizer/seed/instructions.cpp b/projects/Randomizer/seed/instructions.cpp index 984d7abc61..3730574b20 100644 --- a/projects/Randomizer/seed/instructions.cpp +++ b/projects/Randomizer/seed/instructions.cpp @@ -317,7 +317,16 @@ namespace randomizer::seed { EqualityComparator op; void execute(Seed& seed, SeedMemory& memory) const override { - memory.booleans.set(0, op == EqualityComparator::Equal && memory.get(0) == memory.get(1)); + switch (op) { + case EqualityComparator::Equal: + memory.booleans.set(0, memory.get(0) == memory.get(1)); + break; + case EqualityComparator::NotEqual: + memory.booleans.set(0, memory.get(0) != memory.get(1)); + break; + } + + throw RandoException("Invalid operator in CompareEqual instruction"); } [[nodiscard]] std::string to_string(const Seed& seed, const SeedMemory& memory) const override {