diff options
author | Zefram <zefram@fysh.org> | 2014-07-06 23:35:12 +0100 |
---|---|---|
committer | Vanessa Ezekowitz <vanessaezekowitz@gmail.com> | 2014-07-14 14:55:27 -0400 |
commit | 6432bf721dd90018d651c3b6f1ae16c1a79d8fe6 (patch) | |
tree | 12008813c3f1f07f43377b0d8e600b1603506c4e | |
parent | ce1505d008b273eeff4241453eee114f40ceb6cd (diff) | |
download | pipeworks-6432bf721dd90018d651c3b6f1ae16c1a79d8fe6.tar pipeworks-6432bf721dd90018d651c3b6f1ae16c1a79d8fe6.tar.gz pipeworks-6432bf721dd90018d651c3b6f1ae16c1a79d8fe6.tar.bz2 pipeworks-6432bf721dd90018d651c3b6f1ae16c1a79d8fe6.tar.xz pipeworks-6432bf721dd90018d651c3b6f1ae16c1a79d8fe6.zip |
Don't spill an extra pick from old node breakers
Due to historical shenanigans around the addition of the pick slot to
node breakers, some breakers that were placed before the addition have
ended up with a mese pick in their newly-acquired pick slot, rather than
in the ghost_pick slot where it belongs. This causes these breakers to
spill this ghost pick when they are broken. To avoid this, make pick
spilling conditional on the breaker having a formspec: pre-slot breakers
don't have one.
-rw-r--r-- | node_breaker.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/node_breaker.lua b/node_breaker.lua index 03df35c..3267dc9 100644 --- a/node_breaker.lua +++ b/node_breaker.lua @@ -278,7 +278,7 @@ minetest.register_node("pipeworks:nodebreaker_off", { minetest.get_meta(pos):set_string("owner", placer:get_player_name()) end, after_dig_node = function(pos, oldnode, oldmetadata, digger) - if oldmetadata.inventory.pick then + if oldmetadata.inventory.pick and oldmetadata.fields.formspec then local stack = oldmetadata.inventory.pick[1] if not stack:is_empty() then minetest.add_item(pos, stack) @@ -378,7 +378,7 @@ minetest.register_node("pipeworks:nodebreaker_on", { minetest.get_meta(pos):set_string("owner", placer:get_player_name()) end, after_dig_node = function(pos, oldnode, oldmetadata, digger) - if oldmetadata.inventory.pick then + if oldmetadata.inventory.pick and oldmetadata.fields.formspec then local stack = oldmetadata.inventory.pick[1] if not stack:is_empty() then minetest.add_item(pos, stack) |