From 6f0f43917daa06316deb07febe304484396e8721 Mon Sep 17 00:00:00 2001 From: Kemper <9278383-Kemper-@users.noreply.gitlab.com> Date: Mon, 17 Jan 2022 05:16:33 +0000 Subject: [PATCH] Fix negative energy stat comparisons in item tooltips --- voxygen/src/ui/widgets/item_tooltip.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/voxygen/src/ui/widgets/item_tooltip.rs b/voxygen/src/ui/widgets/item_tooltip.rs index 7de74b6e9d..e2b25c0526 100644 --- a/voxygen/src/ui/widgets/item_tooltip.rs +++ b/voxygen/src/ui/widgets/item_tooltip.rs @@ -1025,7 +1025,7 @@ impl<'a> Widget for ItemTooltip<'a> { } if let Some(e_m_diff) = diff.energy_max() { - if e_m_diff > Energy::ENERGY_EPSILON { + if e_m_diff.abs() > Energy::ENERGY_EPSILON { let text = format!("{} {:.1}", &energy_max_diff.0, e_m_diff); diff_text( text, @@ -1036,7 +1036,7 @@ impl<'a> Widget for ItemTooltip<'a> { } if let Some(e_r_diff) = diff.energy_reward() { - if e_r_diff > Energy::ENERGY_EPSILON { + if e_r_diff.abs() > Energy::ENERGY_EPSILON { let text = format!("{} {:.1}", &energy_reward_diff.0, e_r_diff * 100.0); diff_text(