mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Merge branch 'kemper/negative-energy-diffs' into 'master'
Fix energy stat comparisons with negative diffs in item tooltips See merge request veloren/veloren!3109
This commit is contained in:
commit
8078ed39e1
@ -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(
|
||||
|
Loading…
Reference in New Issue
Block a user