diff --git a/world/src/civ/mod.rs b/world/src/civ/mod.rs index 5aa4122b95..98b345fe7a 100644 --- a/world/src/civ/mod.rs +++ b/world/src/civ/mod.rs @@ -657,13 +657,12 @@ impl Civs { }; if let Some(name) = name { // find average center of the biome - let mut biomes = biome.1.iter(); - // There is always at least 1 biome - let mut center = uniform_idx_as_vec2(map_size_lg, *biomes.next().unwrap()); - biomes.for_each(|b| { - center += uniform_idx_as_vec2(map_size_lg, *b); - center /= 2; - }); + let center = biome + .1 + .iter() + .map(|b| uniform_idx_as_vec2(map_size_lg, *b)) + .sum::>() + / biome.1.len() as i32; // Select the point closest to the center let idx = *biome .1