forked from Mirrorlandia_minetest/minetest
Prevent spawning in rivers with valleys mapgen. Remove unecessary whitespace.
This commit is contained in:
parent
a58c0f458d
commit
752d820206
@ -603,9 +603,23 @@ float MapgenValleys::humidityByTerrain(
|
||||
}
|
||||
|
||||
|
||||
inline int MapgenValleys::getGroundLevelAtPoint(v2s16 p)
|
||||
int MapgenValleys::getGroundLevelAtPoint(v2s16 p)
|
||||
{
|
||||
// Base terrain calculation
|
||||
// ***********************************************
|
||||
// This method (deliberately) does not return correct
|
||||
// terrain values. This may be a problem in the future.
|
||||
// ***********************************************
|
||||
|
||||
// Since MT doesn't normally deal with rivers, check
|
||||
// to make sure this isn't a request for a location
|
||||
// in a river.
|
||||
float rivers = NoisePerlin2D(&noise_rivers->np, p.X, p.Y, seed);
|
||||
|
||||
// If it's wet, return an unusable number.
|
||||
if (fabs(rivers) < river_size)
|
||||
return MAX_MAP_GENERATION_LIMIT;
|
||||
|
||||
// Otherwise, return the real result.
|
||||
return terrainLevelAtPoint(p.X, p.Y);
|
||||
}
|
||||
|
||||
|
@ -100,7 +100,7 @@ public:
|
||||
~MapgenValleys();
|
||||
|
||||
virtual void makeChunk(BlockMakeData *data);
|
||||
inline int getGroundLevelAtPoint(v2s16 p);
|
||||
int getGroundLevelAtPoint(v2s16 p);
|
||||
|
||||
private:
|
||||
EmergeManager *m_emerge;
|
||||
|
Loading…
Reference in New Issue
Block a user