summaryrefslogtreecommitdiff
path: root/src/script/cpp_api
diff options
context:
space:
mode:
Diffstat (limited to 'src/script/cpp_api')
-rw-r--r--src/script/cpp_api/s_node.cpp17
-rw-r--r--src/script/cpp_api/s_node.h2
2 files changed, 19 insertions, 0 deletions
diff --git a/src/script/cpp_api/s_node.cpp b/src/script/cpp_api/s_node.cpp
index 49a825cac..d0b0583c0 100644
--- a/src/script/cpp_api/s_node.cpp
+++ b/src/script/cpp_api/s_node.cpp
@@ -233,3 +233,20 @@ void ScriptApiNode::node_on_receive_fields(v3s16 p,
scriptError("error: %s", lua_tostring(L, -1));
}
+void ScriptApiNode::node_falling_update(v3s16 p)
+{
+ SCRIPTAPI_PRECHECKHEADER
+ lua_getglobal(L, "nodeupdate");
+ push_v3s16(L, p);
+ if(lua_pcall(L, 1, 0, 0))
+ scriptError("error: %s", lua_tostring(L, -1));
+}
+
+void ScriptApiNode::node_falling_update_single(v3s16 p)
+{
+ SCRIPTAPI_PRECHECKHEADER
+ lua_getglobal(L, "nodeupdate_single");
+ push_v3s16(L, p);
+ if(lua_pcall(L, 1, 0, 0))
+ scriptError("error: %s", lua_tostring(L, -1));
+}
diff --git a/src/script/cpp_api/s_node.h b/src/script/cpp_api/s_node.h
index a8c9b3a79..517b4b04e 100644
--- a/src/script/cpp_api/s_node.h
+++ b/src/script/cpp_api/s_node.h
@@ -49,6 +49,8 @@ public:
const std::string &formname,
const std::map<std::string, std::string> &fields,
ServerActiveObject *sender);
+ void node_falling_update(v3s16 p);
+ void node_falling_update_single(v3s16 p);
public:
static struct EnumString es_DrawType[];
static struct EnumString es_ContentParamType[];