From 4b553ece09908dfdee59e9841fdc9420350eda9f Mon Sep 17 00:00:00 2001 From: paramat Date: Sat, 18 Nov 2017 20:37:00 +0000 Subject: Stratum ore: Add option for a constant thickness stratum Add a 'stratum thickness' integer parameter, as an alternative to providing a 2nd noise parameter for thickness variation. --- src/script/lua_api/l_mapgen.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 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 01f9d1c41..e39370323 100644 --- a/src/script/lua_api/l_mapgen.cpp +++ b/src/script/lua_api/l_mapgen.cpp @@ -1116,7 +1116,7 @@ int ModApiMapgen::l_register_ore(lua_State *L) ore->flags |= OREFLAG_USE_NOISE; } else if (ore->NEEDS_NOISE) { errorstream << "register_ore: specified ore type requires valid " - "noise parameters" << std::endl; + "'noise_params' parameter" << std::endl; delete ore; return 0; } @@ -1161,11 +1161,13 @@ int ModApiMapgen::l_register_ore(lua_State *L) OreStratum *orestratum = (OreStratum *)ore; lua_getfield(L, index, "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; + if (read_noiseparams(L, -1, &orestratum->np_stratum_thickness)) + ore->flags |= OREFLAG_USE_NOISE2; lua_pop(L, 1); + orestratum->stratum_thickness = getintfield_default(L, index, + "stratum_thickness", 8); + break; } default: -- cgit v1.2.3