Skip to content

Commit af0a2cb

Browse files
authored
Fix bug in get_enclosing_parameters (#641)
1 parent 6a82e27 commit af0a2cb

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

pumpkin-world/src/biome/multi_noise.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -275,12 +275,11 @@ fn get_batched_tree<T: Clone>(nodes: Vec<TreeNode<T>>) -> Vec<TreeNode<T>> {
275275
fn get_enclosing_parameters<T: Clone>(nodes: &[TreeNode<T>]) -> [ParameterRange; 7] {
276276
assert!(!nodes.is_empty(), "SubTree needs at least one child");
277277
let mut bounds = *nodes[0].bounds();
278-
for node in nodes {
278+
for node in nodes.iter().skip(1) {
279279
for (i, range) in node.bounds().iter().enumerate() {
280-
bounds[i] = *range;
280+
bounds[i] = bounds[i].combine(range);
281281
}
282282
}
283-
284283
bounds
285284
}
286285

pumpkin-world/src/generation/aquifer_sampler.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,6 @@ mod test {
652652

653653
use crate::{
654654
block::ChunkBlockState,
655-
chunk::CHUNK_WIDTH,
656655
generation::{
657656
GlobalRandomConfig, biome_coords,
658657
chunk_noise::{
@@ -702,6 +701,7 @@ mod test {
702701
FluidLevel::new(63, WATER_BLOCK),
703702
FluidLevel::new(-54, LAVA_BLOCK),
704703
));
704+
const CHUNK_WIDTH: usize = 16;
705705
let noise = ChunkNoiseGenerator::new(
706706
base_router,
707707
&RANDOM_CONFIG,

0 commit comments

Comments
 (0)