diff options
author | Thomas Rudin <thomas@rudin.li> | 2018-11-16 21:36:03 +0100 |
---|---|---|
committer | SmallJoker <SmallJoker@users.noreply.github.com> | 2018-11-16 21:36:03 +0100 |
commit | 3d52b679b014a92dad8e298c97095b11533ca0c1 (patch) | |
tree | 9ffc03f2ed29cdc819371f17ed48b8d15482d59c | |
parent | 44cb8df048e09b64214f59db73a3fd23cfe12e77 (diff) |
Quarry: Make use of fake digger from pipeworks (#453)origin/masterorigin/HEAD
Fixes crash when digging empty protected chests (https://github.com/minetest/minetest_game/blob/backport-0.4/mods/default/nodes.lua#L1868)
-rw-r--r-- | technic/machines/HV/quarry.lua | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/technic/machines/HV/quarry.lua b/technic/machines/HV/quarry.lua index b7cc501..0a45559 100644 --- a/technic/machines/HV/quarry.lua +++ b/technic/machines/HV/quarry.lua @@ -146,15 +146,9 @@ local function quarry_run(pos, node) dignode = technic.get_or_load_node(digpos) or minetest.get_node(digpos) local dignodedef = minetest.registered_nodes[dignode.name] or {diggable=false} -- doors mod among other thing does NOT like a nil digger... - local fakedigger = { - get_player_name = function() - return "!technic_quarry_fake_digger" - end, - is_player = function() return false end, - get_wielded_item = function() - return ItemStack("air") - end, - } + local fakedigger = pipeworks.create_fake_player({ + name = owner + }) if not dignodedef.diggable or (dignodedef.can_dig and not dignodedef.can_dig(digpos, fakedigger)) then can_dig = false end |