diff --git a/Cargo.lock b/Cargo.lock index 8b4d65a843..5dfc54bb80 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2953,6 +2953,7 @@ dependencies = [ "minifb 0.12.0 (git+https://github.com/emoon/rust_minifb.git)", "noise 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_chacha 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "vek 0.9.8 (registry+https://github.com/rust-lang/crates.io-index)", "veloren-common 0.2.0", ] diff --git a/world/Cargo.toml b/world/Cargo.toml index 3be35d6247..80ca1726bd 100644 --- a/world/Cargo.toml +++ b/world/Cargo.toml @@ -11,6 +11,7 @@ noise = "0.5.1" fxhash = "0.2.1" lazy_static = "1.3.0" rand = "0.7.0" +rand_chacha = "0.2.1" [dev-dependencies] minifb = { git = "https://github.com/emoon/rust_minifb.git" } diff --git a/world/src/sim/mod.rs b/world/src/sim/mod.rs index 11baa60b1f..c02a1385b9 100644 --- a/world/src/sim/mod.rs +++ b/world/src/sim/mod.rs @@ -15,7 +15,8 @@ use common::{ vol::VolSize, }; use noise::{BasicMulti, HybridMulti, MultiFractal, NoiseFn, RidgedMulti, Seedable, SuperSimplex}; -use rand::{rngs::StdRng, Rng, SeedableRng}; +use rand::{Rng, SeedableRng}; +use rand_chacha::ChaChaRng; use std::ops::{Add, Div, Mul, Neg, Sub}; use vek::*; @@ -49,7 +50,7 @@ pub struct WorldSim { pub(crate) locations: Vec, pub(crate) gen_ctx: GenCtx, - pub rng: StdRng, + pub rng: ChaChaRng, } impl WorldSim { @@ -93,7 +94,7 @@ impl WorldSim { chunks, locations: Vec::new(), gen_ctx, - rng: StdRng::from_seed([ + rng: ChaChaRng::from_seed([ (seed >> 0) as u8, 0, 0,