1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

plant amount fix and ravine amount setting

This commit is contained in:
Perttu Ahola 2010-11-29 14:17:46 +02:00
parent a18525a14e
commit d2090a32d8
2 changed files with 30 additions and 25 deletions

View file

@ -1475,7 +1475,7 @@ MapSector * ServerMap::emergeSector(v2s16 p2d)
{
// Avgslope is the derivative of a hill
float t = avgslope * avgslope;
float a = MAP_BLOCKSIZE * 2 * m_params.plants_amount;
float a = MAP_BLOCKSIZE * m_params.plants_amount;
u32 tree_max;
if(t > 0.03)
tree_max = a / (t/0.03);
@ -1520,8 +1520,9 @@ MapSector * ServerMap::emergeSector(v2s16 p2d)
/*
Add ravine (randomly)
*/
if(m_params.ravines_amount != 0)
{
if(rand()%(s32)(10.0 * m_params.ravines_amount) == 0)
if(rand()%(s32)(10.0 / m_params.ravines_amount) == 0)
{
s16 s = 6;
s16 x = rand()%(MAP_BLOCKSIZE-s*2-1)+s;