mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Fix negative energy stat comparisons in item tooltips
This commit is contained in:
parent
ccfa4da059
commit
6f0f43917d
@ -1025,7 +1025,7 @@ impl<'a> Widget for ItemTooltip<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if let Some(e_m_diff) = diff.energy_max() {
|
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);
|
let text = format!("{} {:.1}", &energy_max_diff.0, e_m_diff);
|
||||||
diff_text(
|
diff_text(
|
||||||
text,
|
text,
|
||||||
@ -1036,7 +1036,7 @@ impl<'a> Widget for ItemTooltip<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if let Some(e_r_diff) = diff.energy_reward() {
|
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 =
|
let text =
|
||||||
format!("{} {:.1}", &energy_reward_diff.0, e_r_diff * 100.0);
|
format!("{} {:.1}", &energy_reward_diff.0, e_r_diff * 100.0);
|
||||||
diff_text(
|
diff_text(
|
||||||
|
Loading…
Reference in New Issue
Block a user