From c8a08b4794b8087b70333c54a5a18f1578472c2e Mon Sep 17 00:00:00 2001 From: IsseW Date: Sun, 9 Oct 2022 23:42:38 +0200 Subject: [PATCH] fix warnings --- world/src/layer/tree.rs | 9 ++------- world/src/lib.rs | 9 ++------- world/src/site2/plot.rs | 9 +++++---- world/src/site2/plot/citadel.rs | 17 +++-------------- 4 files changed, 12 insertions(+), 32 deletions(-) diff --git a/world/src/layer/tree.rs b/world/src/layer/tree.rs index 1365bb2c7c..804c57ec8e 100644 --- a/world/src/layer/tree.rs +++ b/world/src/layer/tree.rs @@ -180,11 +180,7 @@ pub fn apply_trees_to( ForestKind::Redwood => { break 'model TreeModel::Procedural( ProceduralTree::generate( - TreeConfig::redwood( - &mut RandomPerm::new(seed), - scale, - calendar, - ), + TreeConfig::redwood(&mut RandomPerm::new(seed), scale), &mut RandomPerm::new(seed), ), StructureBlock::PineLeaves, @@ -419,7 +415,6 @@ impl TreeConfig { pub fn dead(rng: &mut impl Rng, scale: f32) -> Self { let scale = scale * (0.8 + rng.gen::().powi(2) * 0.5); - let log_scale = 1.0 + scale.log2().max(0.0); Self { trunk_len: 9.0 * scale, @@ -671,7 +666,7 @@ impl TreeConfig { } } - pub fn redwood(rng: &mut impl Rng, scale: f32, calendar: Option<&Calendar>) -> Self { + pub fn redwood(rng: &mut impl Rng, scale: f32) -> Self { let scale = scale * (1.0 + rng.gen::().powi(4) * 0.5); let log_scale = 1.0 + scale.log2().max(0.0); diff --git a/world/src/lib.rs b/world/src/lib.rs index 9a4b5d4a1f..53021aa24e 100644 --- a/world/src/lib.rs +++ b/world/src/lib.rs @@ -7,12 +7,7 @@ )] #![allow(clippy::branches_sharing_code)] // TODO: evaluate #![deny(clippy::clone_on_ref_ptr)] -#![feature( - option_zip, - arbitrary_enum_discriminant, - int_log, - map_first_last, -)] +#![feature(option_zip, arbitrary_enum_discriminant, int_log, map_first_last)] mod all; mod block; @@ -490,7 +485,7 @@ impl World { Some(lod::Object { kind: match tree.forest_kind { all::ForestKind::Oak => lod::ObjectKind::Oak, - all::ForestKind::Pine | all::ForestKind::Frostpine => { + all::ForestKind::Pine | all::ForestKind::Frostpine | all::ForestKind::Redwood => { lod::ObjectKind::Pine }, _ => lod::ObjectKind::Oak, diff --git a/world/src/site2/plot.rs b/world/src/site2/plot.rs index 7994cfae33..edd41253cb 100644 --- a/world/src/site2/plot.rs +++ b/world/src/site2/plot.rs @@ -1,8 +1,8 @@ mod castle; +mod citadel; mod cliff_tower; mod desert_city_multiplot; mod desert_city_temple; -mod citadel; pub mod dungeon; mod giant_tree; mod gnarling; @@ -11,9 +11,10 @@ mod sea_chapel; mod workshop; pub use self::{ - castle::Castle, cliff_tower::CliffTower, desert_city_multiplot::DesertCityMultiPlot, - desert_city_temple::DesertCityTemple, dungeon::Dungeon, giant_tree::GiantTree, - gnarling::GnarlingFortification, house::House, sea_chapel::SeaChapel, workshop::Workshop, citadel::Citadel, + castle::Castle, citadel::Citadel, cliff_tower::CliffTower, + desert_city_multiplot::DesertCityMultiPlot, desert_city_temple::DesertCityTemple, + dungeon::Dungeon, giant_tree::GiantTree, gnarling::GnarlingFortification, house::House, + sea_chapel::SeaChapel, workshop::Workshop, }; use super::*; diff --git a/world/src/site2/plot/citadel.rs b/world/src/site2/plot/citadel.rs index 2050273640..c6e4860bf7 100644 --- a/world/src/site2/plot/citadel.rs +++ b/world/src/site2/plot/citadel.rs @@ -1,16 +1,5 @@ use super::*; -use crate::{ - assets::AssetHandle, - site2::util::Dir, - util::{attempt, sampler::Sampler, RandomField, NEIGHBORS}, - Land, -}; -use common::{ - generation::{ChunkSupplement, EntityInfo}, - terrain::{Structure as PrefabStructure, StructuresGroup}, -}; -use kiddo::{distance::squared_euclidean, KdTree}; -use lazy_static::lazy_static; +use crate::{util::NEIGHBORS, Land}; use rand::prelude::*; use std::ops::{Add, Div, Mul}; use vek::*; @@ -24,7 +13,7 @@ const CELL_SIZE: i32 = 16; pub struct Citadel { name: String, - seed: u32, + _seed: u32, origin: Vec3, radius: i32, grid: Grid>, @@ -83,7 +72,7 @@ impl Citadel { Self { name, - seed, + _seed: seed, origin, radius, grid,