From 9a9302a0b690f696101e77a9a2cf144086d1c4e1 Mon Sep 17 00:00:00 2001 From: IsseW Date: Tue, 10 May 2022 10:24:25 +0200 Subject: [PATCH] Use a seperate rng for peak and biome name gen --- world/src/civ/mod.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/world/src/civ/mod.rs b/world/src/civ/mod.rs index 87cf8b58f6..056a5cb329 100644 --- a/world/src/civ/mod.rs +++ b/world/src/civ/mod.rs @@ -80,17 +80,20 @@ impl Civs { common_base::prof_span!("Civs::generate"); let mut this = Self::default(); let rng = ChaChaRng::from_seed(seed_expan::rng_state(seed)); - let initial_civ_count = initial_civ_count(sim.map_size_lg()); - let mut ctx = GenCtx { sim, rng }; + let name_rng = rng.clone(); + let mut name_ctx = GenCtx { sim, rng: name_rng }; if index.features().peak_naming { info!("starting peak naming"); - this.name_peaks(&mut ctx); + this.name_peaks(&mut name_ctx); } if index.features().biome_naming { info!("starting biome naming"); - this.name_biomes(&mut ctx); + this.name_biomes(&mut name_ctx); } + let initial_civ_count = initial_civ_count(sim.map_size_lg()); + let mut ctx = GenCtx { sim, rng }; + info!("starting cave generation"); for _ in 0..ctx.sim.get_size().product() / 10_000 { this.generate_cave(&mut ctx);