mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Allow multiple cave liquids in a biome definition (#8481)
This allows games to specify biome cave liquids and avoid the old hardcoded behaviour, but preserves the ability to have multiple cave liquids in one biome, such as lava and water. When multiple cave liquids are defined by the biome definition, make each entire cave use a randomly chosen liquid, instead of every small cave segment using a randomly chosen liquid. Plus an optimisation: Don't place nodes if cave liquid is defined as 'air'
This commit is contained in:
parent
6cb6aea969
commit
b1b40fef16
6 changed files with 52 additions and 31 deletions
|
@ -405,7 +405,16 @@ Biome *read_biome_def(lua_State *L, int index, const NodeDefManager *ndef)
|
|||
nn.push_back(getstringfield_default(L, index, "node_river_water", ""));
|
||||
nn.push_back(getstringfield_default(L, index, "node_riverbed", ""));
|
||||
nn.push_back(getstringfield_default(L, index, "node_dust", ""));
|
||||
nn.push_back(getstringfield_default(L, index, "node_cave_liquid", ""));
|
||||
|
||||
size_t nnames = getstringlistfield(L, index, "node_cave_liquid", &nn);
|
||||
// If no cave liquids defined, set list to "ignore" to trigger old hardcoded
|
||||
// cave liquid behaviour.
|
||||
if (nnames == 0) {
|
||||
nn.push_back("ignore");
|
||||
nnames = 1;
|
||||
}
|
||||
b->m_nnlistsizes.push_back(nnames);
|
||||
|
||||
nn.push_back(getstringfield_default(L, index, "node_dungeon", ""));
|
||||
nn.push_back(getstringfield_default(L, index, "node_dungeon_alt", ""));
|
||||
nn.push_back(getstringfield_default(L, index, "node_dungeon_stair", ""));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue