Skip to content

Commit 61bbdd6

Browse files
committedNov 12, 2020
Copy position for can_dig
fixes #10514
1 parent b504a1a commit 61bbdd6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎builtin/game/item.lua

+2-1
Original file line numberDiff line numberDiff line change
@@ -551,8 +551,9 @@ function core.node_dig(pos, node, digger)
551551
local diggername = user_name(digger)
552552
local log = make_log(diggername)
553553
local def = core.registered_nodes[node.name]
554+
-- Copy pos because the callback could modify it
554555
if def and (not def.diggable or
555-
(def.can_dig and not def.can_dig(pos, digger))) then
556+
(def.can_dig and not def.can_dig(vector.new(pos), digger))) then
556557
log("info", diggername .. " tried to dig "
557558
.. node.name .. " which is not diggable "
558559
.. core.pos_to_string(pos))

0 commit comments

Comments
 (0)
Please sign in to comment.