Fix compilation with worldgen turned off.

This commit is contained in:
Isse 2022-08-11 20:27:25 +00:00
parent 900454552a
commit e81dade43f
3 changed files with 12 additions and 7 deletions

View File

@ -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,
);

View File

@ -20,6 +20,7 @@ pub fn add_server_systems(dispatch_builder: &mut DispatcherBuilder) {
dispatch::<sync::Sys>(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);

View File

@ -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(), */