mirror of
https://github.com/luanti-org/luanti.git
synced 2025-09-15 18:57:08 +00:00
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).
This commit is contained in:
parent
21f7e3a987
commit
f065d3a06b
3 changed files with 10 additions and 9 deletions
|
@ -676,9 +676,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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue