mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Add !health.is_dead()
check to renderer
This commit is contained in:
parent
64209967aa
commit
09028f3261
@ -560,15 +560,17 @@ impl Scene {
|
||||
.state
|
||||
.ecs()
|
||||
.read_storage::<comp::LightAnimation>(),
|
||||
&scene_data.state.ecs().read_storage::<comp::Health>(),
|
||||
)
|
||||
.join()
|
||||
.filter(|(pos, _, light_anim)| {
|
||||
.filter(|(pos, _, light_anim, h)| {
|
||||
light_anim.col != Rgb::zero()
|
||||
&& light_anim.strength > 0.0
|
||||
&& (pos.0.distance_squared(player_pos) as f32)
|
||||
< loaded_distance.powi(2) + LIGHT_DIST_RADIUS
|
||||
&& !h.is_dead
|
||||
})
|
||||
.map(|(pos, interpolated, light_anim)| {
|
||||
.map(|(pos, interpolated, light_anim, _)| {
|
||||
// Use interpolated values if they are available
|
||||
let pos = interpolated.map_or(pos.0, |i| i.pos);
|
||||
Light::new(pos + light_anim.offset, light_anim.col, light_anim.strength)
|
||||
|
Loading…
Reference in New Issue
Block a user