aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api
diff options
context:
space:
mode:
authorSmallJoker <SmallJoker@users.noreply.github.com>2019-09-21 11:44:24 +0200
committerGitHub <noreply@github.com>2019-09-21 11:44:24 +0200
commit5fa614d97e13af64be490336392abe2a54fdcbc1 (patch)
tree32a0856d971d850081c1a7e748ab3f96a103ea19 /src/script/lua_api
parent47da640d7763ee1e00badb7476ac5afc4f864367 (diff)
downloadminetest-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.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;
}