diff --git a/README.md b/README.md index c8f0e47fab..f2f2dc15ef 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,13 @@ # Fresh -An experiment \ No newline at end of file +An experiment + +## Compile + +``` +git clone https://gitlab.com/veloren/fresh.git +cd fresh +git submodule update --init --recursive +rustup default nightly +cargo build +``` diff --git a/common/src/clock.rs b/common/src/clock.rs index 437fe77c57..57e71756e8 100644 --- a/common/src/clock.rs +++ b/common/src/clock.rs @@ -25,7 +25,7 @@ impl Clock { pub fn get_last_delta(&self) -> Duration { self.last_delta.unwrap_or(Duration::new(0, 0)) } - pub fn get_avg_delta(&self) -> Duration { Duration::from_float_secs(self.running_tps_average) } + pub fn get_avg_delta(&self) -> Duration { Duration::from_secs_f64(self.running_tps_average) } pub fn tick(&mut self, tgt: Duration) { let delta = SystemTime::now() @@ -45,6 +45,6 @@ impl Clock { self.last_delta = Some(delta); self.running_tps_average = CLOCK_SMOOTHING * self.running_tps_average + - (1.0 - CLOCK_SMOOTHING) * delta.as_float_secs(); + (1.0 - CLOCK_SMOOTHING) * delta.as_secs_f64(); } } diff --git a/common/src/state.rs b/common/src/state.rs index 2e516759e8..663d6b8237 100644 --- a/common/src/state.rs +++ b/common/src/state.rs @@ -168,11 +168,11 @@ impl State { /// Execute a single tick, simulating the game state by the given duration. pub fn tick(&mut self, dt: Duration) { // Change the time accordingly - self.ecs_world.write_resource::().0 += dt.as_float_secs() * DAY_CYCLE_FACTOR; - self.ecs_world.write_resource::