Fix bat entity path

This commit is contained in:
Syniis 2024-02-25 14:58:07 +01:00
parent 41ccb873ed
commit 2f051f9c6a

View File

@ -1570,7 +1570,7 @@ fn apply_entity_spawns<R: Rng>(canvas: &mut Canvas, wpos: Vec3<i32>, biome: &Bio
0.5, 0.5,
), ),
( (
Some("common.entity.wild.aggressive.bat"), Some("common.entity.wild.peaceful.bat"),
biome.mushroom + 0.1, biome.mushroom + 0.1,
0.25, 0.25,
0.5, 0.5,
@ -1630,7 +1630,7 @@ fn apply_entity_spawns<R: Rng>(canvas: &mut Canvas, wpos: Vec3<i32>, biome: &Bio
0.5, 0.5,
), ),
( (
Some("common.entity.wild.aggressive.bat"), Some("common.entity.wild.peaceful.bat"),
biome.leafy + 0.1, biome.leafy + 0.1,
0.25, 0.25,
0.5, 0.5,
@ -1666,7 +1666,7 @@ fn apply_entity_spawns<R: Rng>(canvas: &mut Canvas, wpos: Vec3<i32>, biome: &Bio
0.5, 0.5,
), ),
( (
Some("common.entity.wild.aggressive.bat"), Some("common.entity.wild.peaceful.bat"),
biome.dusty.max(biome.sandy).max(biome.snowy) + 0.1, biome.dusty.max(biome.sandy).max(biome.snowy) + 0.1,
0.25, 0.25,
0.5, 0.5,
@ -1784,8 +1784,12 @@ fn apply_entity_spawns<R: Rng>(canvas: &mut Canvas, wpos: Vec3<i32>, biome: &Bio
.iter() .iter()
.filter_map(|(entity, biome_modifier, chance, cutoff)| { .filter_map(|(entity, biome_modifier, chance, cutoff)| {
if let Some(entity) = entity { if let Some(entity) = entity {
let close = close(1.0, *biome_modifier, *cutoff, 2); if *biome_modifier > *cutoff {
(close > 0.0).then(|| (Some(entity), close * chance)) let close = close(1.0, *biome_modifier, *cutoff, 2);
(close > 0.0).then(|| (Some(entity), close * chance))
} else {
None
}
} else { } else {
Some((None, 100.0)) Some((None, 100.0))
} }