diff --git a/client/src/lib.rs b/client/src/lib.rs index 8f57187f2b..293c668399 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -1003,8 +1003,7 @@ impl Client { } pub fn set_lod_distance(&mut self, lod_distance: u32) { - #[allow(clippy::manual_clamp)] - let lod_distance = lod_distance.max(0).min(1000) as f32 / lod::ZONE_SIZE as f32; + let lod_distance = lod_distance.clamp(0, 1000) as f32 / lod::ZONE_SIZE as f32; self.lod_distance = lod_distance; } diff --git a/common/src/volumes/chunk.rs b/common/src/volumes/chunk.rs index 7c92e064a5..fffc607f42 100644 --- a/common/src/volumes/chunk.rs +++ b/common/src/volumes/chunk.rs @@ -71,7 +71,7 @@ impl Chunk { Self::GROUP_VOLUME / (Self::GROUP_LONG_SIDE_LEN * Self::GROUP_LONG_SIDE_LEN), ); const GROUP_VOLUME: u32 = [Self::VOLUME / 256, 1][(Self::VOLUME < 256) as usize]; - const VOLUME: u32 = (S::SIZE.x * S::SIZE.y * S::SIZE.z); + const VOLUME: u32 = S::SIZE.x * S::SIZE.y * S::SIZE.z; /// Creates a new `Chunk` with the provided dimensions and all voxels filled /// with duplicates of the provided voxel. diff --git a/world/src/column/mod.rs b/world/src/column/mod.rs index d78c4cbf84..6b5da228c7 100644 --- a/world/src/column/mod.rs +++ b/world/src/column/mod.rs @@ -263,7 +263,7 @@ impl<'a> Sampler<'a> for ColumnGen<'a> { ) { let water_chunk = posj.map(|e| e as f64); let lake_width_noise = - sim.gen_ctx.small_nz.get((wposf.div(32.0)).into_array()); + sim.gen_ctx.small_nz.get(wposf.div(32.0).into_array()); let water_aabr = Aabr { min: water_chunk * neighbor_coef + 4.0 - lake_width_noise * 8.0, max: (water_chunk + 1.0) * neighbor_coef - 4.0 @@ -312,7 +312,7 @@ impl<'a> Sampler<'a> for ColumnGen<'a> { RiverKind::Ocean => { let water_chunk = posj.map(|e| e as f64); let lake_width_noise = - sim.gen_ctx.small_nz.get((wposf.div(32.0)).into_array()); + sim.gen_ctx.small_nz.get(wposf.div(32.0).into_array()); let water_aabr = Aabr { min: water_chunk * neighbor_coef + 4.0 - lake_width_noise * 8.0, max: (water_chunk + 1.0) * neighbor_coef - 4.0 + lake_width_noise * 8.0,