mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
refactor: joined on &stats twice
This commit is contained in:
parent
2fc4a8d9aa
commit
4a99e5bc1e
@ -489,18 +489,12 @@ impl Hud {
|
||||
let mut health_back_id_walker = self.ids.health_bar_backs.walk();
|
||||
|
||||
// Render Name Tags
|
||||
for (pos, name, level, scale) in (
|
||||
&entities,
|
||||
&pos,
|
||||
&stats,
|
||||
&stats,
|
||||
players.maybe(),
|
||||
scales.maybe(),
|
||||
)
|
||||
for (pos, name, level, scale) in
|
||||
(&entities, &pos, &stats, players.maybe(), scales.maybe())
|
||||
.join()
|
||||
.filter(|(entity, _, stats, _, _, _)| *entity != me && !stats.is_dead)
|
||||
.filter(|(entity, _, stats, _, _)| *entity != me && !stats.is_dead)
|
||||
// Don't process nametags outside the vd (visibility further limited by ui backend)
|
||||
.filter(|(_, pos, _, _, _, _)| {
|
||||
.filter(|(_, pos, _, _, _)| {
|
||||
Vec2::from(pos.0 - player_pos)
|
||||
.map2(TerrainChunk::RECT_SIZE, |d: f32, sz| {
|
||||
d.abs() as f32 / sz as f32
|
||||
@ -508,7 +502,7 @@ impl Hud {
|
||||
.magnitude()
|
||||
< view_distance as f32
|
||||
})
|
||||
.map(|(_, pos, stats, _, player, scale)| {
|
||||
.map(|(_, pos, stats, player, scale)| {
|
||||
// TODO: This is temporary
|
||||
// If the player used the default character name display their name instead
|
||||
let name = if stats.name == "Character Name" {
|
||||
|
Loading…
Reference in New Issue
Block a user