From dcd3fb2077a2cbe243c3661dc2207bbdd6af687a Mon Sep 17 00:00:00 2001 From: Corvella <10601026-Corvella@users.noreply.gitlab.com> Date: Thu, 26 Jan 2023 14:27:59 +0000 Subject: [PATCH] Correctly apply LoD distance setting and improve documentation on projectile fixes --- common/systems/src/projectile.rs | 8 ++++---- voxygen/src/session/mod.rs | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/common/systems/src/projectile.rs b/common/systems/src/projectile.rs index 2870625e6c..87cac616c4 100644 --- a/common/systems/src/projectile.rs +++ b/common/systems/src/projectile.rs @@ -95,7 +95,7 @@ impl<'a> System<'a> for Sys { let mut projectile_vanished: bool = false; // Hit entity - for (&other, &pos_other) in physics.touch_entities.iter() { + for (&other, &pos_hit_other) in physics.touch_entities.iter() { let same_group = projectile_owner // Note: somewhat inefficient since we do the lookup for every touching // entity, but if we pull this out of the loop we would want to do it only @@ -127,8 +127,8 @@ impl<'a> System<'a> for Sys { let entity_of = |uid: Uid| read_data.uid_allocator.retrieve_entity_internal(uid.into()); - // Don't hit if there is a surface in the entity's way in the direction the - // projectile is going + // Don't hit if there is terrain between the projectile and where the entity was + // supposed to be hit by it. if physics.on_surface().is_some() { let projectile_direction = orientations @@ -138,7 +138,7 @@ impl<'a> System<'a> for Sys { if !matches!( read_data .terrain - .ray(pos_wall, pos_other) + .ray(pos_wall, pos_hit_other) .until(|b| b.is_filled()) .cast() .1, diff --git a/voxygen/src/session/mod.rs b/voxygen/src/session/mod.rs index 7a9a70ba40..1d9eed565b 100644 --- a/voxygen/src/session/mod.rs +++ b/voxygen/src/session/mod.rs @@ -113,6 +113,9 @@ impl SessionState { scene .camera_mut() .set_fov_deg(global_state.settings.graphics.fov); + client + .borrow_mut() + .set_lod_distance(global_state.settings.graphics.lod_distance); #[cfg(not(target_os = "macos"))] let mut mumble_link = SharedLink::new("veloren", "veloren-voxygen"); {