Merge branch 'zesterer/fix-nametags' into 'master'

Fixed nametag logic bug

See merge request veloren/veloren!3088
This commit is contained in:
Joshua Barretto 2022-01-07 22:38:59 +00:00
commit 3cba7e7f87

View File

@ -1830,27 +1830,26 @@ impl Hud {
// entity has been damaged, is targeted/selected, or is in your group
// Note: even if this passes the healthbar can be hidden in some cases if it
// is at maximum
let display_overhead_info =
(info.target_entity.map_or(false, |e| e == entity)
let display_overhead_info = !is_me
&& (info.target_entity.map_or(false, |e| e == entity)
|| info.selected_entity.map_or(false, |s| s.0 == entity)
|| health.map_or(true, overhead::should_show_healthbar)
|| in_group
|| is_merchant
|| !is_me)
&& dist_sqr
< (if in_group {
NAMETAG_GROUP_RANGE
} else if is_merchant {
NAMETAG_MERCHANT_RANGE
} else if hpfl
.time_since_last_dmg_by_me
.map_or(false, |t| t < NAMETAG_DMG_TIME)
{
NAMETAG_DMG_RANGE
} else {
NAMETAG_RANGE
})
.powi(2);
|| is_merchant)
&& dist_sqr
< (if in_group {
NAMETAG_GROUP_RANGE
} else if is_merchant {
NAMETAG_MERCHANT_RANGE
} else if hpfl
.time_since_last_dmg_by_me
.map_or(false, |t| t < NAMETAG_DMG_TIME)
{
NAMETAG_DMG_RANGE
} else {
NAMETAG_RANGE
})
.powi(2);
let info = display_overhead_info.then(|| overhead::Info {
name: &stats.name,