From 6e7def937fff0a4057c8f3c1803788656ae68e9c Mon Sep 17 00:00:00 2001 From: Tim Felgentreff <timfelgentreff@gmail.com> Date: Sat, 2 Apr 2022 11:02:20 +0200 Subject: [PATCH] fix negative condition for panel content on variable value --- src/ui/mainscr.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ui/mainscr.cpp b/src/ui/mainscr.cpp index 2b462922d..6ef21d44d 100644 --- a/src/ui/mainscr.cpp +++ b/src/ui/mainscr.cpp @@ -237,6 +237,8 @@ static bool CanShowContent(const ConditionPanel *condition, const CUnit &unit) if (f >= -v) { return false; } + } else { + return false; } } else if (v > CONDITION_ONLY) { // only show for more than (v-CONDITION_ONLY)% @@ -245,6 +247,8 @@ static bool CanShowContent(const ConditionPanel *condition, const CUnit &unit) if (f <= v - CONDITION_ONLY) { return false; } + } else { + return false; } } else if (v != CONDITION_TRUE) { if ((v == CONDITION_ONLY) ^ unit.Variable[i].Enable) {