summaryrefslogtreecommitdiff
path: root/builtin/game/item.lua
diff options
context:
space:
mode:
authorLars Müller <34514239+appgurueu@users.noreply.github.com>2022-05-09 20:42:43 +0200
committerGitHub <noreply@github.com>2022-05-09 20:42:43 +0200
commit089797dbe68679b744304ba016e08d30df15ab28 (patch)
treefb0d755c98145dc60fca79bb361552735b8112cf /builtin/game/item.lua
parent53c70b5f27f2978029cb40845a82b681c844ec42 (diff)
downloadminetest-089797dbe68679b744304ba016e08d30df15ab28.tar.gz
minetest-089797dbe68679b744304ba016e08d30df15ab28.tar.bz2
minetest-089797dbe68679b744304ba016e08d30df15ab28.zip
Fix Minetest blaming the wrong mod for errors (#12241)
Covers the case where mods insert their callbacks manually into "minetest.registered_<callbacks>" (often to achieve a particular order of execution).
Diffstat (limited to 'builtin/game/item.lua')
-rw-r--r--builtin/game/item.lua4
1 files changed, 1 insertions, 3 deletions
diff --git a/builtin/game/item.lua b/builtin/game/item.lua
index 439a71679..5543e9a3f 100644
--- a/builtin/game/item.lua
+++ b/builtin/game/item.lua
@@ -529,9 +529,7 @@ function core.node_dig(pos, node, digger)
-- Run script hook
for _, callback in ipairs(core.registered_on_dignodes) do
local origin = core.callback_origins[callback]
- if origin then
- core.set_last_run_mod(origin.mod)
- end
+ core.set_last_run_mod(origin.mod)
-- Copy pos and node because callback can modify them
local pos_copy = vector.new(pos)