1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Fix object reference pushing functions when called from coroutines

This commit is contained in:
ShadowNinja 2014-10-02 15:58:13 -04:00
parent 28438bba27
commit 741df993ff
10 changed files with 42 additions and 45 deletions

View file

@ -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();
}