summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2020-11-10 21:43:06 +0100
committersfan5 <sfan5@live.de>2020-11-12 21:08:26 +0100
commit61bbdd6807f4c383b7300b4fd5931f5e09dc7205 (patch)
treeaacffbb9816015fa1249d4aff1bd3758054607eb /builtin
parentb504a1aa4bdc56676b4b1c398ebfe98d336f8f6e (diff)
downloadminetest-61bbdd6807f4c383b7300b4fd5931f5e09dc7205.tar.gz
minetest-61bbdd6807f4c383b7300b4fd5931f5e09dc7205.tar.bz2
minetest-61bbdd6807f4c383b7300b4fd5931f5e09dc7205.zip
Copy position for can_dig
fixes #10514
Diffstat (limited to 'builtin')
-rw-r--r--builtin/game/item.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin/game/item.lua b/builtin/game/item.lua
index f680ce0d4..109712b42 100644
--- a/builtin/game/item.lua
+++ b/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))