diff options
author | paramat <paramat@users.noreply.github.com> | 2017-09-30 10:23:57 +0100 |
---|---|---|
committer | paramat <mat.gregory@virginmedia.com> | 2017-10-01 22:31:44 +0100 |
commit | e2afcf85ce5945a6ed08313dfed9f68d02912f73 (patch) | |
tree | 684f7f9bec103e188289fc2996b495a701651f48 /src/script | |
parent | 9fa78b7387ec6eb5f6e3419d37ae631085c69e1a (diff) | |
download | minetest-e2afcf85ce5945a6ed08313dfed9f68d02912f73.tar.gz minetest-e2afcf85ce5945a6ed08313dfed9f68d02912f73.tar.bz2 minetest-e2afcf85ce5945a6ed08313dfed9f68d02912f73.zip |
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.
Diffstat (limited to 'src/script')
-rw-r--r-- | src/script/lua_api/l_mapgen.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
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; |