aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api/l_nodemeta.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/script/lua_api/l_nodemeta.cpp')
-rw-r--r--src/script/lua_api/l_nodemeta.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/script/lua_api/l_nodemeta.cpp b/src/script/lua_api/l_nodemeta.cpp
index 57052cb42..34760157d 100644
--- a/src/script/lua_api/l_nodemeta.cpp
+++ b/src/script/lua_api/l_nodemeta.cpp
@@ -89,7 +89,10 @@ int NodeMetaRef::l_get_inventory(lua_State *L)
NodeMetaRef *ref = checkobject(L, 1);
ref->getmeta(true); // try to ensure the metadata exists
- InvRef::createNodeMeta(L, ref->m_p);
+
+ InventoryLocation loc;
+ loc.setNodeMeta(ref->m_p);
+ InvRef::create(L, loc);
return 1;
}
@@ -234,7 +237,7 @@ void NodeMetaRef::RegisterCommon(lua_State *L)
void NodeMetaRef::Register(lua_State *L)
{
RegisterCommon(L);
- luaL_openlib(L, 0, methodsServer, 0); // fill methodtable
+ luaL_register(L, nullptr, methodsServer); // fill methodtable
lua_pop(L, 1); // drop methodtable
}
@@ -260,7 +263,7 @@ const luaL_Reg NodeMetaRef::methodsServer[] = {
void NodeMetaRef::RegisterClient(lua_State *L)
{
RegisterCommon(L);
- luaL_openlib(L, 0, methodsClient, 0); // fill methodtable
+ luaL_register(L, nullptr, methodsClient); // fill methodtable
lua_pop(L, 1); // drop methodtable
}