mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-11 17:51:04 +00:00
Randomwalk cave liquids: Remove deprecated 'lava depth' parameter (#9105)
Low-disruption first step towards removing the hardcoded cave liquid code. Since MT 5.0.0 cave liquids can be defined and located by biome definitions instead. In games that do not yet use biome definitions to define and locate cave liquids (MTGame does), lava will now appear below y = water_level - 256 instead of below 'lava depth' (usually y = -256). Therefore no change in most mapgens if using the default 'lava depth'.
This commit is contained in:
parent
706b6aad06
commit
97764600e2
17 changed files with 7 additions and 62 deletions
|
@ -281,7 +281,6 @@ CavesRandomWalk::CavesRandomWalk(
|
|||
content_t water_source,
|
||||
content_t lava_source,
|
||||
float large_cave_flooded,
|
||||
int lava_depth,
|
||||
BiomeGen *biomegen)
|
||||
{
|
||||
assert(ndef);
|
||||
|
@ -292,7 +291,6 @@ CavesRandomWalk::CavesRandomWalk(
|
|||
this->water_level = water_level;
|
||||
this->np_caveliquids = &nparams_caveliquids;
|
||||
this->large_cave_flooded = large_cave_flooded;
|
||||
this->lava_depth = lava_depth;
|
||||
this->bmgn = biomegen;
|
||||
|
||||
c_water_source = water_source;
|
||||
|
@ -530,12 +528,12 @@ void CavesRandomWalk::carveRoute(v3f vec, float f, bool randomize_xz)
|
|||
if (use_biome_liquid) {
|
||||
liquidnode = c_biome_liquid;
|
||||
} else {
|
||||
// TODO remove this. Cave liquids are now defined and located using biome
|
||||
// definitions.
|
||||
// If cave liquid not defined by biome, fallback to old hardcoded behaviour.
|
||||
// TODO 'np_caveliquids' is deprecated and should eventually be removed.
|
||||
// Cave liquids are now defined and located using biome definitions.
|
||||
float nval = NoisePerlin3D(np_caveliquids, startp.X,
|
||||
startp.Y, startp.Z, seed);
|
||||
liquidnode = (nval < 0.40f && node_max.Y < lava_depth) ?
|
||||
liquidnode = (nval < 0.40f && node_max.Y < water_level - 256) ?
|
||||
lavanode : waternode;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue