diff --git a/server/src/lib.rs b/server/src/lib.rs index 85c2e3a1ad..8af72f1c0e 100644 --- a/server/src/lib.rs +++ b/server/src/lib.rs @@ -12,7 +12,6 @@ option_zip, unwrap_infallible )] -#![cfg_attr(not(feature = "worldgen"), feature(const_panic))] pub mod automod; mod character_creator; @@ -39,7 +38,9 @@ pub mod sys; #[cfg(feature = "persistent_world")] pub mod terrain_persistence; #[cfg(not(feature = "worldgen"))] mod test_world; + mod weather; + pub mod wiring; // Reexports @@ -546,12 +547,13 @@ impl Server { // Initiate real-time world simulation #[cfg(feature = "worldgen")] - rtsim::init(&mut state, &world, index.as_index_ref(), spawn_point); + { + rtsim::init(&mut state, &world, index.as_index_ref(), spawn_point); + weather::init(&mut state, &world); + } #[cfg(not(feature = "worldgen"))] rtsim::init(&mut state); - weather::init(&mut state, &world); - let this = Self { state, world, @@ -689,8 +691,10 @@ impl Server { sys::msg::add_server_systems(dispatcher_builder); sys::add_server_systems(dispatcher_builder); #[cfg(feature = "worldgen")] - rtsim::add_server_systems(dispatcher_builder); - weather::add_server_systems(dispatcher_builder); + { + rtsim::add_server_systems(dispatcher_builder); + weather::add_server_systems(dispatcher_builder); + } }, false, ); diff --git a/server/src/weather/mod.rs b/server/src/weather/mod.rs index 46ad28540c..3d36d15d59 100644 --- a/server/src/weather/mod.rs +++ b/server/src/weather/mod.rs @@ -20,6 +20,7 @@ pub fn add_server_systems(dispatch_builder: &mut DispatcherBuilder) { dispatch::(dispatch_builder, &[&tick::Sys::sys_name()]); } +#[cfg(feature = "worldgen")] pub fn init(state: &mut State, world: &world::World) { let weather_size = world.sim().get_size() / CHUNKS_PER_CELL; let sim = WeatherSim::new(weather_size, world); diff --git a/voxygen/src/scene/lod.rs b/voxygen/src/scene/lod.rs index dc7044a8b1..83ace9d18e 100644 --- a/voxygen/src/scene/lod.rs +++ b/voxygen/src/scene/lod.rs @@ -53,7 +53,7 @@ impl Lod { client.world_data().lod_base.raw(), client.world_data().lod_alt.raw(), client.world_data().lod_horizon.raw(), - client.world_data().chunk_size().as_() / weather::CHUNKS_PER_CELL, + (client.world_data().chunk_size().as_() / weather::CHUNKS_PER_CELL).map(|e| e.max(1)), settings.graphics.lod_detail.max(100).min(2500), /* TODO: figure out how we want to do this without color borders? * water_color().into_array().into(), */