From 741df993ff33832d773536ed571c1a67ed93b5cb Mon Sep 17 00:00:00 2001 From: ShadowNinja Date: Thu, 2 Oct 2014 15:58:13 -0400 Subject: Fix object reference pushing functions when called from coroutines --- src/script/cpp_api/s_node.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 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 8c9b46c2a..05f908004 100644 --- a/src/script/cpp_api/s_node.cpp +++ b/src/script/cpp_api/s_node.cpp @@ -103,7 +103,7 @@ bool ScriptApiNode::node_on_punch(v3s16 p, MapNode node, // Call function push_v3s16(L, p); pushnode(L, node, ndef); - objectrefGetOrCreate(puncher); + objectrefGetOrCreate(L, puncher); pushPointedThing(pointed); if (lua_pcall(L, 4, 0, m_errorhandler)) scriptError(); @@ -124,7 +124,7 @@ bool ScriptApiNode::node_on_dig(v3s16 p, MapNode node, // Call function push_v3s16(L, p); pushnode(L, node, ndef); - objectrefGetOrCreate(digger); + objectrefGetOrCreate(L, digger); if (lua_pcall(L, 3, 0, m_errorhandler)) scriptError(); return true; @@ -227,7 +227,7 @@ void ScriptApiNode::node_on_receive_fields(v3s16 p, lua_pushlstring(L, value.c_str(), value.size()); lua_settable(L, -3); } - objectrefGetOrCreate(sender); // player + objectrefGetOrCreate(L, sender); // player if (lua_pcall(L, 4, 0, m_errorhandler)) scriptError(); } -- cgit v1.2.3