Biome generation: Fix layers of 'filler' nodes at biome y limits
authorparamat <paramat@users.noreply.github.com>
Sun, 17 Sep 2017 01:54:17 +0000 (02:54 +0100)
committerparamat <mat.gregory@virginmedia.com>
Sun, 17 Sep 2017 02:20:20 +0000 (03:20 +0100)
Error was exposed by commit a1389c38658fe69c3bd25c3099bae9a4e51ed401
'nplaced' was not set to U16_MAX when biome 'stone' was placed, so when
biome was recalculated in a column of stone, the 'nplaced' value
caused a few remaining filler nodes to be placed.
Occurs when the lower biome has a deeper depth of 'top' plus 'filler'
than the upper biome.

src/mapgen.cpp

index 1d72ec037dcaeb43b7b0631973b7f2bb4247b30e..72c075466c7f25c6b8c9706e92cc0883a23a5e54 100644 (file)
@@ -722,6 +722,7 @@ void MapgenBasic::generateBiomes(MgStoneType *mgstone_type,
                                        nplaced++;
                                } else {
                                        vm->m_data[vi] = MapNode(biome->c_stone);
+                                       nplaced = U16_MAX;  // Disable top/filler placement
                                }
 
                                air_above = false;