Skip to content

Commit 99143f4

Browse files
authoredJun 2, 2018
Biomemap: Avoid empty biomemap entry to fix failing biome dust (#7393)
'generateBiomes()' constructs the biomemap as it generates biomes. The biome calculated at first stone surface encountered is added to the biomemap. Previously, if no stone surface was encountered in a mapchunk column the biomemap was left empty for that (x, z) position, causing biome dust and water surface decoration placement to fail. If at the base of a mapchunk column the biomemap is empty, add the currently active biome to the biomemap, or if biome is NULL calculate it for this position and add it to the biomemap.
1 parent 162ffd7 commit 99143f4

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
 

Diff for: ‎src/mapgen/mapgen.cpp

+14
Original file line numberDiff line numberDiff line change
@@ -692,6 +692,7 @@ void MapgenBasic::generateBiomes()
692692
// (Re)calculate biome
693693
biome = biomegen->getBiomeAtIndex(index, v3s16(x, y, z));
694694

695+
// Add biome to biomemap at first stone surface detected
695696
if (biomemap[index] == BIOME_NONE && is_stone_surface)
696697
biomemap[index] = biome->index;
697698

@@ -761,6 +762,19 @@ void MapgenBasic::generateBiomes()
761762

762763
VoxelArea::add_y(em, vi, -1);
763764
}
765+
// If no stone surface was detected in this mapchunk column the biomemap
766+
// will be empty for this (x, z) position. Add the currently active
767+
// biome to the biomemap, or if biome is NULL calculate it for this
768+
// position.
769+
if (biomemap[index] == BIOME_NONE) {
770+
if (biome) {
771+
biomemap[index] = biome->index;
772+
} else {
773+
biome =
774+
biomegen->getBiomeAtIndex(index, v3s16(x, node_min.Y, z));
775+
biomemap[index] = biome->index;
776+
}
777+
}
764778
}
765779
}
766780

0 commit comments

Comments
 (0)