Distinguish NAMETAG_MERCHANT_RANGE from NAMETAG_GROUP_RANGE.

This commit is contained in:
Avi Weinstock 2021-05-08 17:16:53 -04:00
parent eb3cc2fd22
commit 0f424ec95a

View File

@ -177,6 +177,8 @@ const MENU_BG: Color = Color::Rgba(0.1, 0.12, 0.12, 1.0);
/// Distance at which nametags are visible for group members
const NAMETAG_GROUP_RANGE: f32 = 1000.0;
/// Distance at which nametags are visible for merchants
const NAMETAG_MERCHANT_RANGE: f32 = 50.0;
/// Distance at which nametags are visible
const NAMETAG_RANGE: f32 = 40.0;
/// Time nametags stay visible after doing damage even if they are out of range
@ -1572,8 +1574,10 @@ impl Hud {
|| in_group
|| is_merchant)
&& dist_sqr
< (if in_group || is_merchant {
< (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)