From 089797dbe68679b744304ba016e08d30df15ab28 Mon Sep 17 00:00:00 2001 From: Lars Müller <34514239+appgurueu@users.noreply.github.com> Date: Mon, 9 May 2022 20:42:43 +0200 Subject: Fix Minetest blaming the wrong mod for errors (#12241) Covers the case where mods insert their callbacks manually into "minetest.registered_" (often to achieve a particular order of execution). --- builtin/game/item.lua | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'builtin/game/item.lua') 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) -- cgit v1.2.3