Merge pull request #55 from Thomas--S/fix-ta4chest-animal-crash

Fix TA4 chest client crash
This commit is contained in:
Joachim Stolberg 2021-03-26 21:13:02 +01:00 committed by GitHub
commit 7356319350
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -276,7 +276,12 @@ local function formspec_container(x, y, nvm, inv)
count = stack.count,
wear = stack.wear,
})
itemstack:get_meta():from_table(minetest.deserialize(stack.meta))
local stack_meta_table = (minetest.deserialize(stack.meta) or {}).fields or {}
for _, key in ipairs({"description", "short_description", "color", "palette_index"}) do
if stack_meta_table[key] then
itemstack:get_meta():set_string(key, stack_meta_table[key])
end
end
local itemname = itemstack:to_string()
--tbl[#tbl+1] = "item_image["..xpos..",1;1,1;"..itemname.."]"
tbl[#tbl+1] = techage.item_image(xpos, 0, itemname, stack.count)