add sanity check for upgrade cases of autocrafters with broken metadata (especially for can_dig)

This commit is contained in:
Tim 2015-01-29 17:04:07 +01:00
parent 73b3466a7b
commit 373c7951d2

@ -209,7 +209,9 @@ local function upgrade_autocrafter(pos, meta)
-- we allready dropped stuff, so lets remove the metadatasetting (we are not being called again for this node)
meta:set_string("virtual_items", "")
else -- we are version 1
for idx, stack in ipairs(inv:get_list("recipe")) do
local recipe = inv:get_list("recipe")
if not recipe then return end
for idx, stack in ipairs(recipe) do
if not stack:is_empty() then
minetest.item_drop(stack, "", pos)
stack:set_count(1)