diff --git a/client/src/lib.rs b/client/src/lib.rs index a04165415e..79ef38080f 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -1858,8 +1858,11 @@ impl Client { // 1 for the chunks needed bordering other chunks for meshing // 1 as a buffer so that if the player moves back in that direction the chunks // don't need to be reloaded + // Take the minimum of the adjusted difference vs the view_distance + 1 to + // prevent magnitude_squared from overflowing + if (chunk_pos - key) - .map(|e: i32| (e.unsigned_abs()).saturating_sub(2)) + .map(|e: i32| (e.unsigned_abs()).saturating_sub(2).min(view_distance + 1)) .magnitude_squared() > view_distance.pow(2) { diff --git a/voxygen/src/hud/minimap.rs b/voxygen/src/hud/minimap.rs index 9e15d1b1dd..3dfe4ef4bd 100644 --- a/voxygen/src/hud/minimap.rs +++ b/voxygen/src/hud/minimap.rs @@ -276,7 +276,7 @@ impl VoxelMinimap { ) .unwrap_or(0) }; - if cpos.distance_squared(self.last_pos.xy()) >= 1 + if self.last_pos.xy() != cpos || self.last_pos.z != pos.z as i32 || self.last_ceiling != ceiling_offset || new_chunks