aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api
diff options
context:
space:
mode:
authorParamat <paramat@users.noreply.github.com>2018-04-05 17:21:41 +0100
committerGitHub <noreply@github.com>2018-04-05 17:21:41 +0100
commit32d456bd2d4dda50f77c01c702d1b5a5ff26134b (patch)
tree5f70367cacdc3901d3a9746563aad5ed3b3054c4 /src/script/lua_api
parent077f231111082272359a916c3e41049aaf699151 (diff)
downloadminetest-32d456bd2d4dda50f77c01c702d1b5a5ff26134b.tar.gz
minetest-32d456bd2d4dda50f77c01c702d1b5a5ff26134b.tar.bz2
minetest-32d456bd2d4dda50f77c01c702d1b5a5ff26134b.zip
Biome API / cavegen: Add definable cave liquid for a biome (#7192)
Add 'node_cave_liquid' as a new field in biome registration. If field is absent cave liquids fall back to classic behaviour.
Diffstat (limited to 'src/script/lua_api')
-rw-r--r--src/script/lua_api/l_mapgen.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/script/lua_api/l_mapgen.cpp b/src/script/lua_api/l_mapgen.cpp
index d7bb96086..03a2b3eea 100644
--- a/src/script/lua_api/l_mapgen.cpp
+++ b/src/script/lua_api/l_mapgen.cpp
@@ -389,9 +389,11 @@ Biome *read_biome_def(lua_State *L, int index, const NodeDefManager *ndef)
b->vertical_blend = getintfield_default(L, index, "vertical_blend", 0);
b->flags = 0; // reserved
- b->min_pos = getv3s16field_default(L, index, "min_pos", v3s16(-31000, -31000, -31000));
+ b->min_pos = getv3s16field_default(
+ L, index, "min_pos", v3s16(-31000, -31000, -31000));
getintfield(L, index, "y_min", b->min_pos.Y);
- b->max_pos = getv3s16field_default(L, index, "max_pos", v3s16(31000, 31000, 31000));
+ b->max_pos = getv3s16field_default(
+ L, index, "max_pos", v3s16(31000, 31000, 31000));
getintfield(L, index, "y_max", b->max_pos.Y);
std::vector<std::string> &nn = b->m_nodenames;
@@ -403,6 +405,7 @@ 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", ""));
ndef->pendNodeResolve(b);
return b;