1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2025-06-28 06:11:47 +02:00

remove armors drop, replaced by bones mod soon

fix crash in unified_inventory, on join if died, detached inventory is nil
This commit is contained in:
2017-01-24 18:31:10 +01:00
parent 06a1153d25
commit 2cb3a70846
2 changed files with 7 additions and 2 deletions

View File

@ -311,7 +311,11 @@ function unified_inventory.extract_bag(player, id)
end
pinv:remove_item("bag" .. id, stack)
minetest.get_inventory({type = "detached", name = minetest.formspec_escape(player:get_player_name()) .. "_bags"}):set_stack("bag" .. id, 1, nil)
local dinv = minetest.get_inventory({type = "detached", name = minetest.formspec_escape(player:get_player_name()) .. "_bags"})
if dinv then
dinv:set_stack("bag" .. id, 1, nil)
end
pinv:set_list("bag" .. id .. "contents", {})
stack:set_metadata(minetest.serialize(list))