diff options
author | Zefram <zefram@fysh.org> | 2014-07-21 12:24:06 +0100 |
---|---|---|
committer | Vanessa Ezekowitz <vanessaezekowitz@gmail.com> | 2014-07-21 09:52:53 -0400 |
commit | 22eb00e5d1c0f9f1cce144beb7ad3f6cdb000768 (patch) | |
tree | c363b2120b333860f96a2b38e9eb7eed9c361d53 /node_breaker.lua | |
parent | aee9f7e6d682e91a20958d16c192baa6dce6c2e4 (diff) | |
download | pipeworks-22eb00e5d1c0f9f1cce144beb7ad3f6cdb000768.tar pipeworks-22eb00e5d1c0f9f1cce144beb7ad3f6cdb000768.tar.gz pipeworks-22eb00e5d1c0f9f1cce144beb7ad3f6cdb000768.tar.bz2 pipeworks-22eb00e5d1c0f9f1cce144beb7ad3f6cdb000768.tar.xz pipeworks-22eb00e5d1c0f9f1cce144beb7ad3f6cdb000768.zip |
Let stack of projectiles diminish in node breaker
The logic that prevents mechanically wearing a tool was also preventing
the diminution of a stack of items to use, such as a stack of snowballs.
Restrict the use of pickcopy to the case where the stack still has the
same item type, count, and metadata.
Diffstat (limited to 'node_breaker.lua')
-rw-r--r-- | node_breaker.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/node_breaker.lua b/node_breaker.lua index 103f74f..a02324e 100644 --- a/node_breaker.lua +++ b/node_breaker.lua @@ -179,7 +179,8 @@ local function break_node (pos, facedir) end - if pickdef and (not pickdef.wear_represents or pickdef.wear_represents == "mechanical_wear") then + local newpick = inv:get_stack(pick_inv, 1) + if newpick:get_name() == pickcopy:get_name() and newpick:get_count() == pickcopy:get_count() and newpick:get_metadata() == pickcopy:get_metadata() and pickdef and (not pickdef.wear_represents or pickdef.wear_represents == "mechanical_wear") then inv:set_stack(pick_inv, 1, pickcopy) -- Do not wear pick out end |