diff options
author | Tim <t4im@users.noreply.github.com> | 2015-01-29 17:04:07 +0100 |
---|---|---|
committer | Tim <t4im@users.noreply.github.com> | 2015-01-29 17:06:09 +0100 |
commit | 373c7951d2bb40ba0e5c08a922aa9ece6e6f7dcd (patch) | |
tree | c61bd47ba04459ea80c9ed4ba0caf89c9eae625f | |
parent | 73b3466a7bee24196ec3b36256d735aff26a9ac4 (diff) | |
download | pipeworks-373c7951d2bb40ba0e5c08a922aa9ece6e6f7dcd.tar pipeworks-373c7951d2bb40ba0e5c08a922aa9ece6e6f7dcd.tar.gz pipeworks-373c7951d2bb40ba0e5c08a922aa9ece6e6f7dcd.tar.bz2 pipeworks-373c7951d2bb40ba0e5c08a922aa9ece6e6f7dcd.tar.xz pipeworks-373c7951d2bb40ba0e5c08a922aa9ece6e6f7dcd.zip |
add sanity check for upgrade cases of autocrafters with broken metadata (especially for can_dig)
-rw-r--r-- | autocrafter.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/autocrafter.lua b/autocrafter.lua index 012015a..a24560e 100644 --- a/autocrafter.lua +++ b/autocrafter.lua @@ -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) |