Biomes: Fix vertical biome blend
authorparamat <paramat@users.noreply.github.com>
Thu, 15 Mar 2018 04:29:09 +0000 (04:29 +0000)
committerparamat <mat.gregory@virginmedia.com>
Fri, 16 Mar 2018 02:59:38 +0000 (02:59 +0000)
src/mapgen/mg_biome.cpp

index 376f2d4483aedf3e3a47534bb1bf7f060232ea9e..7f091f31380170417ca0a9d0e10a25ad03d51591 100644 (file)
@@ -139,7 +139,7 @@ Biome *BiomeManager::getBiomeFromNoiseOriginal(float heat, float humidity, v3s16
        }
 
        mysrand(pos.Y + (heat + humidity) / 2);
-       if (biome_closest_blend &&
+       if (biome_closest_blend && dist_min_blend <= dist_min &&
                        myrand_range(0, biome_closest_blend->vertical_blend) >=
                        pos.Y - biome_closest_blend->max_pos.Y)
                return biome_closest_blend;
@@ -300,7 +300,7 @@ Biome *BiomeGenOriginal::calcBiomeFromNoise(float heat, float humidity, v3s16 po
        // blend.
        mysrand(pos.Y + (heat + humidity) / 2);
 
-       if (biome_closest_blend &&
+       if (biome_closest_blend && dist_min_blend <= dist_min &&
                        myrand_range(0, biome_closest_blend->vertical_blend) >=
                        pos.Y - biome_closest_blend->max_pos.Y)
                return biome_closest_blend;