From 3aedfac9685c2d9ae8bac5a5b7e72e527f22c08d Mon Sep 17 00:00:00 2001 From: proller Date: Sat, 27 Jul 2013 22:34:30 +0400 Subject: Weather support --- src/script/cpp_api/s_node.cpp | 17 +++++++++++++++++ src/script/cpp_api/s_node.h | 2 ++ 2 files changed, 19 insertions(+) (limited to 'src/script/cpp_api') 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 &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[]; -- cgit v1.2.3