From 32d456bd2d4dda50f77c01c702d1b5a5ff26134b Mon Sep 17 00:00:00 2001 From: Paramat Date: Thu, 5 Apr 2018 17:21:41 +0100 Subject: 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. --- src/script/lua_api/l_mapgen.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/script/lua_api') 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 &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; -- cgit v1.2.3