Use a seperate rng for peak and biome name gen

This commit is contained in:
IsseW 2022-05-10 10:24:25 +02:00
parent bed8ae68fe
commit 9a9302a0b6

View File

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