summaryrefslogtreecommitdiff
path: root/src/script
diff options
context:
space:
mode:
authorkwolekr <kwolekr@minetest.net>2014-12-10 00:56:44 -0500
committerkwolekr <kwolekr@minetest.net>2014-12-10 00:56:44 -0500
commitcfba55ba0a79eb1a4e9250d6dcc7ed4dd2bd519e (patch)
tree38fc831ee02f25810b1134a8fbdb0d871ef0a1d4 /src/script
parentfb2bc956b18bd70a47bff00d5726d4754867856a (diff)
downloadminetest-cfba55ba0a79eb1a4e9250d6dcc7ed4dd2bd519e.tar.gz
minetest-cfba55ba0a79eb1a4e9250d6dcc7ed4dd2bd519e.tar.bz2
minetest-cfba55ba0a79eb1a4e9250d6dcc7ed4dd2bd519e.zip
Remove get_noiseparams function. read_noiseparams should be used from now on
Diffstat (limited to 'src/script')
-rw-r--r--src/script/common/c_content.cpp12
-rw-r--r--src/script/common/c_content.h2
-rw-r--r--src/script/lua_api/l_mapgen.cpp8
3 files changed, 4 insertions, 18 deletions
diff --git a/src/script/common/c_content.cpp b/src/script/common/c_content.cpp
index 1c78f139f..cab346cae 100644
--- a/src/script/common/c_content.cpp
+++ b/src/script/common/c_content.cpp
@@ -975,18 +975,6 @@ void luaentity_get(lua_State *L, u16 id)
}
/******************************************************************************/
-NoiseParams *get_noiseparams(lua_State *L, int index)
-{
- NoiseParams *np = new NoiseParams;
-
- if (!read_noiseparams(L, index, np)) {
- delete np;
- np = NULL;
- }
-
- return np;
-}
-
bool read_noiseparams(lua_State *L, int index, NoiseParams *np)
{
if (index < 0)
diff --git a/src/script/common/c_content.h b/src/script/common/c_content.h
index 02e3e29fa..834db319b 100644
--- a/src/script/common/c_content.h
+++ b/src/script/common/c_content.h
@@ -147,8 +147,6 @@ bool string_to_enum (const EnumString *spec,
int &result,
const std::string &str);
-NoiseParams* get_noiseparams (lua_State *L, int index);
-
bool read_noiseparams (lua_State *L, int index,
NoiseParams *np);
bool get_schematic (lua_State *L, int index,
diff --git a/src/script/lua_api/l_mapgen.cpp b/src/script/lua_api/l_mapgen.cpp
index 3176b920c..03a2ee0d5 100644
--- a/src/script/lua_api/l_mapgen.cpp
+++ b/src/script/lua_api/l_mapgen.cpp
@@ -394,9 +394,12 @@ int ModApiMapgen::l_register_decoration(lua_State *L)
for (size_t i = 0; i != place_on_names.size(); i++)
resolver->addNodeList(place_on_names[i], &deco->c_place_on);
+ getflagsfield(L, index, "flags", flagdesc_deco, &deco->flags, NULL);
+
//// Get NoiseParams to define how decoration is placed
lua_getfield(L, index, "noise_params");
- deco->np = get_noiseparams(L, -1);
+ if (read_noiseparams(L, -1, &deco->np))
+ deco->flags |= DECO_USE_NOISE;
lua_pop(L, 1);
//// Get biomes associated with this decoration (if any)
@@ -482,9 +485,6 @@ bool ModApiMapgen::regDecoSchematic(lua_State *L, INodeDefManager *ndef,
{
int index = 1;
- deco->flags = 0;
- getflagsfield(L, index, "flags", flagdesc_deco_schematic, &deco->flags, NULL);
-
deco->rotation = (Rotation)getenumfield(L, index, "rotation",
es_Rotation, ROTATE_0);