From 76d4396fa148a44f6aaee38d188d4c2cf8c90c7f Mon Sep 17 00:00:00 2001 From: ShadowNinja Date: Thu, 23 Jan 2014 19:21:01 -0500 Subject: Pass pointed_thing to on_punch and minetest.register_on_punchnode callbacks --- src/script/cpp_api/s_node.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/script/cpp_api/s_node.cpp') diff --git a/src/script/cpp_api/s_node.cpp b/src/script/cpp_api/s_node.cpp index cd8451cf0..55db43584 100644 --- a/src/script/cpp_api/s_node.cpp +++ b/src/script/cpp_api/s_node.cpp @@ -24,6 +24,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "nodedef.h" #include "server.h" #include "environment.h" +#include "util/pointedthing.h" struct EnumString ScriptApiNode::es_DrawType[] = @@ -87,7 +88,7 @@ ScriptApiNode::~ScriptApiNode() { } bool ScriptApiNode::node_on_punch(v3s16 p, MapNode node, - ServerActiveObject *puncher) + ServerActiveObject *puncher, PointedThing pointed) { SCRIPTAPI_PRECHECKHEADER @@ -104,7 +105,8 @@ bool ScriptApiNode::node_on_punch(v3s16 p, MapNode node, push_v3s16(L, p); pushnode(L, node, ndef); objectrefGetOrCreate(puncher); - if(lua_pcall(L, 3, 0, errorhandler)) + pushPointedThing(pointed); + if(lua_pcall(L, 4, 0, errorhandler)) scriptError(); lua_pop(L, 1); // Pop error handler return true; -- cgit v1.2.3