diff options
Diffstat (limited to 'src/script/cpp_api/s_item.cpp')
-rw-r--r-- | src/script/cpp_api/s_item.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/script/cpp_api/s_item.cpp b/src/script/cpp_api/s_item.cpp index ab82b6b47..e3a9ac7aa 100644 --- a/src/script/cpp_api/s_item.cpp +++ b/src/script/cpp_api/s_item.cpp @@ -40,7 +40,7 @@ bool ScriptApiItem::item_OnDrop(ItemStack &item, // Call function LuaItemStack::create(L, item); - objectrefGetOrCreate(dropper); + objectrefGetOrCreate(L, dropper); pushFloatPos(L, pos); if (lua_pcall(L, 3, 1, m_errorhandler)) scriptError(); @@ -66,7 +66,7 @@ bool ScriptApiItem::item_OnPlace(ItemStack &item, // Call function LuaItemStack::create(L, item); - objectrefGetOrCreate(placer); + objectrefGetOrCreate(L, placer); pushPointedThing(pointed); if (lua_pcall(L, 3, 1, m_errorhandler)) scriptError(); @@ -92,7 +92,7 @@ bool ScriptApiItem::item_OnUse(ItemStack &item, // Call function LuaItemStack::create(L, item); - objectrefGetOrCreate(user); + objectrefGetOrCreate(L, user); pushPointedThing(pointed); if (lua_pcall(L, 3, 1, m_errorhandler)) scriptError(); @@ -115,7 +115,7 @@ bool ScriptApiItem::item_OnCraft(ItemStack &item, ServerActiveObject *user, lua_getglobal(L, "core"); lua_getfield(L, -1, "on_craft"); LuaItemStack::create(L, item); - objectrefGetOrCreate(user); + objectrefGetOrCreate(L, user); // Push inventory list std::vector<ItemStack> items; @@ -146,7 +146,7 @@ bool ScriptApiItem::item_CraftPredict(ItemStack &item, ServerActiveObject *user, lua_getglobal(L, "core"); lua_getfield(L, -1, "craft_predict"); LuaItemStack::create(L, item); - objectrefGetOrCreate(user); + objectrefGetOrCreate(L, user); //Push inventory list std::vector<ItemStack> items; @@ -229,7 +229,7 @@ void ScriptApiItem::pushPointedThing(const PointedThing& pointed) { lua_pushstring(L, "object"); lua_setfield(L, -2, "type"); - objectrefGet(pointed.object_id); + objectrefGet(L, pointed.object_id); lua_setfield(L, -2, "ref"); } else |