Always generate at least one civilization

This commit is contained in:
James Hiew 2023-05-10 15:32:38 +01:00
parent db860de517
commit 3a85a8d399
No known key found for this signature in database

View File

@ -29,12 +29,13 @@ use rand_chacha::ChaChaRng;
use tracing::{debug, info, warn};
use vek::*;
const fn initial_civ_count(map_size_lg: MapSizeLg) -> u32 {
fn initial_civ_count(map_size_lg: MapSizeLg) -> u32 {
// NOTE: since map_size_lg's dimensions must fit in a u16, we can safely add
// them here.
//
// NOTE: 48 at "default" scale of 10 × 10 chunk bits (1024 × 1024 chunks).
(3 << (map_size_lg.vec().x + map_size_lg.vec().y)) >> 16
let cnt = (3 << (map_size_lg.vec().x + map_size_lg.vec().y)) >> 16;
cnt.max(1) // we need at least one civ in order to generate a starting site
}
pub struct CaveInfo {