1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-25 21:55:25 +02:00

Move Mapgen V7 river generation into the main generation loop (#10639)

All terrain generation now occurs in one loop, instead of rivers being
carved afterwards in a separate loop.
Fixes the removal of nodes added by mods in 'register on generated'.
Avoids other problems and reduces the chance of future bugs.
Mapchunk generation time is reduced.

Also fixes a code mistake which resulted in river channel generation
being disabled at floatland altitudes even when floatlands were disabled.
This commit is contained in:
Paramat
2020-11-20 16:11:19 +00:00
committed by GitHub
parent 2f6393f49d
commit 872dce5020
2 changed files with 32 additions and 49 deletions

View File

@@ -94,10 +94,10 @@ public:
float baseTerrainLevelFromMap(int index);
bool getMountainTerrainAtPoint(s16 x, s16 y, s16 z);
bool getMountainTerrainFromMap(int idx_xyz, int idx_xz, s16 y);
bool getRiverChannelFromMap(int idx_xyz, int idx_xz, s16 y);
bool getFloatlandTerrainFromMap(int idx_xyz, float float_offset);
int generateTerrain();
void generateRidgeTerrain();
private:
s16 mount_zero_level;