Fix itemstack serialization

This commit is contained in:
SmallJoker 2019-08-10 17:24:01 +02:00
parent 291eca26be
commit d1bed76864

@ -26,6 +26,9 @@ function upgrade_packs.inv_to_meta(player)
local inv = player:get_inventory() local inv = player:get_inventory()
local list = inv:get_list("ugpacks") local list = inv:get_list("ugpacks")
if list and not inv:is_empty("ugpacks") then if list and not inv:is_empty("ugpacks") then
for i, v in ipairs(list) do
list[i] = v:to_table()
end
meta:set_string("upgrade_packs:ugpacks", minetest.serialize(list)) meta:set_string("upgrade_packs:ugpacks", minetest.serialize(list))
end end
inv:set_size("ugpacks", 0) inv:set_size("ugpacks", 0)