Fixed nametag logic bug

This commit is contained in:
Joshua Barretto 2022-01-07 21:54:14 +00:00
parent e12390b08b
commit bc7c942bc9

View File

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