diff options
author | SmallJoker <SmallJoker@users.noreply.github.com> | 2019-09-21 11:44:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-21 11:44:24 +0200 |
commit | 5fa614d97e13af64be490336392abe2a54fdcbc1 (patch) | |
tree | 32a0856d971d850081c1a7e748ab3f96a103ea19 /src/script/lua_api | |
parent | 47da640d7763ee1e00badb7476ac5afc4f864367 (diff) | |
download | minetest-5fa614d97e13af64be490336392abe2a54fdcbc1.tar.gz minetest-5fa614d97e13af64be490336392abe2a54fdcbc1.tar.bz2 minetest-5fa614d97e13af64be490336392abe2a54fdcbc1.zip |
Wieldhand: Specify which ItemStack to use (#8961)
Makes 'get_wield_item' to return the "main" ItemStack
Diffstat (limited to 'src/script/lua_api')
-rw-r--r-- | src/script/lua_api/l_object.cpp | 4 |
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; } |