diff options
author | proller <proller@github.com> | 2013-07-27 22:34:30 +0400 |
---|---|---|
committer | proller <proller@github.com> | 2013-07-27 23:21:48 +0400 |
commit | 3aedfac9685c2d9ae8bac5a5b7e72e527f22c08d (patch) | |
tree | d1f9067040acb0b5dad42a2ae8935b91124a36d3 /src/script/cpp_api | |
parent | e65d8ad6553d7ae0acf63b43e9818059088a00b6 (diff) | |
download | minetest-3aedfac9685c2d9ae8bac5a5b7e72e527f22c08d.tar.gz minetest-3aedfac9685c2d9ae8bac5a5b7e72e527f22c08d.tar.bz2 minetest-3aedfac9685c2d9ae8bac5a5b7e72e527f22c08d.zip |
Weather support
Diffstat (limited to 'src/script/cpp_api')
-rw-r--r-- | src/script/cpp_api/s_node.cpp | 17 | ||||
-rw-r--r-- | src/script/cpp_api/s_node.h | 2 |
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[]; |