aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api
diff options
context:
space:
mode:
Diffstat (limited to 'src/script/lua_api')
-rw-r--r--src/script/lua_api/l_object.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/script/lua_api/l_object.cpp b/src/script/lua_api/l_object.cpp
index 1ad79024f..22445fc9a 100644
--- a/src/script/lua_api/l_object.cpp
+++ b/src/script/lua_api/l_object.cpp
@@ -340,7 +340,9 @@ int ObjectRef::l_get_wielded_item(lua_State *L)
return 1;
}
- LuaItemStack::create(L, co->getWieldedItem());
+ ItemStack selected_item;
+ co->getWieldedItem(&selected_item, nullptr);
+ LuaItemStack::create(L, selected_item);
return 1;
}