From e2afcf85ce5945a6ed08313dfed9f68d02912f73 Mon Sep 17 00:00:00 2001 From: paramat Date: Sat, 30 Sep 2017 10:23:57 +0100 Subject: Stratum ore: Allow use with no noise for simple horizontal strata If either of the 2 noise parameters are omitted the ore will occur from y_min to y_max in a simple horizontal stratum. As this does not compute noise performance improves, and is ideal for placing many layers. Clean up some nearby ore documentation. --- src/script/lua_api/l_mapgen.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/script/lua_api/l_mapgen.cpp') diff --git a/src/script/lua_api/l_mapgen.cpp b/src/script/lua_api/l_mapgen.cpp index 7757ea80c..b179ac407 100644 --- a/src/script/lua_api/l_mapgen.cpp +++ b/src/script/lua_api/l_mapgen.cpp @@ -1156,7 +1156,9 @@ int ModApiMapgen::l_register_ore(lua_State *L) OreStratum *orestratum = (OreStratum *)ore; lua_getfield(L, index, "np_stratum_thickness"); - read_noiseparams(L, -1, &orestratum->np_stratum_thickness); + // If thickness noise missing unset 'use noise' flag + if (!read_noiseparams(L, -1, &orestratum->np_stratum_thickness)) + ore->flags &= ~OREFLAG_USE_NOISE; lua_pop(L, 1); break; -- cgit v1.2.3