diff --git a/world/src/lib.rs b/world/src/lib.rs index 75c6a2e69c..745515cd54 100644 --- a/world/src/lib.rs +++ b/world/src/lib.rs @@ -148,7 +148,10 @@ impl World { const SPAWN_RATE: f32 = 0.1; const BOSS_RATE: f32 = 0.03; let supplement = ChunkSupplement { - npcs: if rand::thread_rng().gen::() < SPAWN_RATE && sim_chunk.chaos < 0.5 { + npcs: if rand::thread_rng().gen::() < SPAWN_RATE + && sim_chunk.chaos < 0.5 + && !sim_chunk.is_underwater + { vec![NpcInfo { pos: gen_entity_pos(), boss: rand::thread_rng().gen::() < BOSS_RATE, diff --git a/world/src/sim/mod.rs b/world/src/sim/mod.rs index ce7a484676..8735ad135b 100644 --- a/world/src/sim/mod.rs +++ b/world/src/sim/mod.rs @@ -970,6 +970,7 @@ pub struct SimChunk { pub spawn_rate: f32, pub location: Option, pub river: RiverData, + pub is_underwater: bool, pub structures: Structures, } @@ -1146,6 +1147,7 @@ impl SimChunk { } else { 0.0 }, + is_underwater, is_cliffs: cliff > 0.5 && !is_underwater, near_cliffs: cliff > 0.2, tree_density,