1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Add get_wielded_item

This commit is contained in:
red-001 2017-01-31 13:18:52 +00:00 committed by Loïc Blot
parent 44ca9c9cb2
commit 88df9fb5b6
15 changed files with 92 additions and 33 deletions

View file

@ -364,7 +364,7 @@ int ObjectRef::l_set_wielded_item(lua_State *L)
ServerActiveObject *co = getobject(ref);
if (co == NULL) return 0;
// Do it
ItemStack item = read_item(L, 2, getServer(L));
ItemStack item = read_item(L, 2, getServer(L)->idef());
bool success = co->setWieldedItem(item);
if (success && co->getType() == ACTIVEOBJECT_TYPE_PLAYER) {
getServer(L)->SendInventory(((PlayerSAO*)co));