From 8f5e409ac4213ae4cdaf50b53d59c9dc233bd4f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20M=C3=A4rtens?= Date: Sun, 9 Feb 2020 22:15:10 +0100 Subject: [PATCH] update toolchain to --- common/src/comp/controller.rs | 4 ++-- rust-toolchain | 2 +- world/src/sim/mod.rs | 6 +++--- world/src/sim/util.rs | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/common/src/comp/controller.rs b/common/src/comp/controller.rs index 2f74fffbb8..63faaa7133 100644 --- a/common/src/comp/controller.rs +++ b/common/src/comp/controller.rs @@ -57,12 +57,12 @@ impl Input { /// Whether it's the first frame this input has been in /// its current state - pub fn is_just_pressed(&self) -> bool { (self.just_changed && self.is_pressed()) } + pub fn is_just_pressed(&self) -> bool { self.just_changed && self.is_pressed() } /// Whether input has been in current state longer than /// `DEFAULT_HOLD_DURATION` pub fn is_held_down(&self) -> bool { - (self.is_pressed() && self.duration >= DEFAULT_HOLD_DURATION) + self.is_pressed() && self.duration >= DEFAULT_HOLD_DURATION } /// Handles logic of updating state of Input diff --git a/rust-toolchain b/rust-toolchain index 238b1af439..47892367f9 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -nightly-2020-01-18 +nightly-2020-02-06 diff --git a/world/src/sim/mod.rs b/world/src/sim/mod.rs index ea945ae27a..feb3643eb5 100644 --- a/world/src/sim/mod.rs +++ b/world/src/sim/mod.rs @@ -574,7 +574,7 @@ impl WorldSim { fn spring(x: f64, pow: f64) -> f64 { x.abs().powf(pow) * x.signum() } - (0.0 + alt_main + 0.0 + alt_main + (gen_ctx .small_nz .get( @@ -590,7 +590,7 @@ impl WorldSim { .mul(0.3) .add(1.0) .mul(0.4) - + spring(alt_main.abs().powf(0.5).min(0.75).mul(60.0).sin(), 4.0).mul(0.045)) + + spring(alt_main.abs().powf(0.5).min(0.75).mul(60.0).sin(), 4.0).mul(0.045) }; // Now we can compute the final altitude using chaos. @@ -669,7 +669,7 @@ impl WorldSim { let alt_exp_max_uniform = inv_func(max_epsilon); let erosion_factor = |x: f64| { - ((inv_func(x) - alt_exp_min_uniform) / (alt_exp_max_uniform - alt_exp_min_uniform)) + (inv_func(x) - alt_exp_min_uniform) / (alt_exp_max_uniform - alt_exp_min_uniform) }; let rock_strength_div_factor = (2.0 * TerrainChunkSize::RECT_SIZE.x as f64) / 8.0; let theta_func = |_posi| 0.4; diff --git a/world/src/sim/util.rs b/world/src/sim/util.rs index 5333d20657..fa138c40bf 100644 --- a/world/src/sim/util.rs +++ b/world/src/sim/util.rs @@ -175,12 +175,12 @@ pub fn uniform_noise( let mut noise = (0..WORLD_SIZE.x * WORLD_SIZE.y) .into_par_iter() .filter_map(|i| { - (f( + f( i, (uniform_idx_as_vec2(i) * TerrainChunkSize::RECT_SIZE.map(|e| e as i32)) .map(|e| e as f64), ) - .map(|res| (i, res))) + .map(|res| (i, res)) }) .collect::>();