* Improvements in accuracy of the world generator

* Fix a crash.
This commit is contained in:
iProgramInCpp
2023-08-04 18:35:06 +03:00
parent 06e26862c8
commit 79ec0e6994
3 changed files with 17 additions and 3 deletions

View File

@@ -114,7 +114,7 @@ Biome::~Biome()
Feature* Biome::getTreeFeature(Random* pRandom)
{
pRandom->genrand_int32(); //! unused result
pRandom->nextInt(10); // unused result
return new TreeFeature;
}
@@ -202,7 +202,7 @@ void Biome::initBiomes()
Feature* RainforestBiome::getTreeFeature(Random* pRandom)
{
pRandom->genrand_int32(); //! unused result
pRandom->nextInt(3); // unused result
return new TreeFeature;
}
@@ -210,11 +210,15 @@ Feature* RainforestBiome::getTreeFeature(Random* pRandom)
Feature* ForestBiome::getTreeFeature(Random* pRandom)
{
if (pRandom->nextInt(5) == 0)
{
return new BirchFeature;
}
// @NOTE: Here would be code for a big tree with random->nextInt(3).
// But PE doesn't have big trees
pRandom->nextInt(3);
return new TreeFeature;
}