fix negative condition for panel content on variable value

This commit is contained in:
Tim Felgentreff 2022-04-02 11:02:20 +02:00
parent 99579eea94
commit 6e7def937f

View file

@ -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) {