From 1b305dd617fae70506bd2ea9ed5224af958d78f4 Mon Sep 17 00:00:00 2001 From: Q-I-U Date: Sun, 24 Oct 2021 20:45:57 +0200 Subject: [PATCH 1/2] Prevent lantern from turning off on death --- server/src/events/entity_manipulation.rs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/server/src/events/entity_manipulation.rs b/server/src/events/entity_manipulation.rs index 56cc85dbae..24de925db5 100644 --- a/server/src/events/entity_manipulation.rs +++ b/server/src/events/entity_manipulation.rs @@ -322,10 +322,6 @@ pub fn handle_destroy(server: &mut Server, entity: EcsEntity, last_change: Healt .insert(entity, comp::ForceUpdate) .err() .map(|e| error!(?e, ?entity, "Failed to insert ForceUpdate on dead client")); - state - .ecs() - .write_storage::() - .remove(entity); state .ecs() .write_storage::() From fe76156432be035eca64533bf2ce7cccdcdbef87 Mon Sep 17 00:00:00 2001 From: Q-I-U Date: Sun, 24 Oct 2021 21:49:19 +0200 Subject: [PATCH 2/2] Add `!health.is_dead()` check to renderer --- voxygen/src/scene/mod.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/voxygen/src/scene/mod.rs b/voxygen/src/scene/mod.rs index 9d17c29eab..e56a3a9c35 100644 --- a/voxygen/src/scene/mod.rs +++ b/voxygen/src/scene/mod.rs @@ -560,15 +560,17 @@ impl Scene { .state .ecs() .read_storage::(), + &scene_data.state.ecs().read_storage::(), ) .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)