Skip to content
Permalink
Browse files

Copy position for can_dig

fixes #10514
  • Loading branch information
sfan5 committed Nov 12, 2020
1 parent b504a1a commit 61bbdd6807f4c383b7300b4fd5931f5e09dc7205
Showing with 2 additions and 1 deletion.
  1. +2 −1 builtin/game/item.lua
@@ -551,8 +551,9 @@ function core.node_dig(pos, node, digger)
local diggername = user_name(digger)
local log = make_log(diggername)
local def = core.registered_nodes[node.name]
-- Copy pos because the callback could modify it
if def and (not def.diggable or
(def.can_dig and not def.can_dig(pos, digger))) then
(def.can_dig and not def.can_dig(vector.new(pos), digger))) then
log("info", diggername .. " tried to dig "
.. node.name .. " which is not diggable "
.. core.pos_to_string(pos))

0 comments on commit 61bbdd6

Please sign in to comment.
You can’t perform that action at this time.