aboutsummaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2021-01-31 18:49:51 +0000
committerGitHub <noreply@github.com>2021-01-31 18:49:51 +0000
commit6e0e0324a48130376ab3c9fef03b84ee25608242 (patch)
tree2ca83874980f8ade05401b828477fb0d03867886 /builtin
parentd1ec5117d9095c75aca26a98690e4fcc5385e98c (diff)
downloadminetest-6e0e0324a48130376ab3c9fef03b84ee25608242.tar.gz
minetest-6e0e0324a48130376ab3c9fef03b84ee25608242.tar.bz2
minetest-6e0e0324a48130376ab3c9fef03b84ee25608242.zip
Fix minetest.dig_node returning true when node isn't diggable (#10890)
Diffstat (limited to 'builtin')
-rw-r--r--builtin/game/item.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/builtin/game/item.lua b/builtin/game/item.lua
index 63f8d50e5..881aff52e 100644
--- a/builtin/game/item.lua
+++ b/builtin/game/item.lua
@@ -557,7 +557,7 @@ function core.node_dig(pos, node, digger)
log("info", diggername .. " tried to dig "
.. node.name .. " which is not diggable "
.. core.pos_to_string(pos))
- return
+ return false
end
if core.is_protected(pos, diggername) then
@@ -566,7 +566,7 @@ function core.node_dig(pos, node, digger)
.. " at protected position "
.. core.pos_to_string(pos))
core.record_protection_violation(pos, diggername)
- return
+ return false
end
log('action', diggername .. " digs "
@@ -649,6 +649,8 @@ function core.node_dig(pos, node, digger)
local node_copy = {name=node.name, param1=node.param1, param2=node.param2}
callback(pos_copy, node_copy, digger)
end
+
+ return true
end
function core.itemstring_with_palette(item, palette_index)