1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-13 00:25:19 +02:00

Fix debug.getinfo not being unset in CPCSM (#16506)

regression was introduced in eeb6cab
This commit is contained in:
DS
2025-10-01 12:52:48 +02:00
committed by GitHub
parent 499f2284bd
commit ae35167a5e
6 changed files with 15 additions and 9 deletions

View File

@@ -1,5 +1,6 @@
local builtin_shared = ...
local S = core.get_translator("__builtin")
local debug_getinfo = debug.getinfo
--
-- Make raw registration functions inaccessible to anyone except this file
@@ -548,7 +549,7 @@ function core.registered_on_player_hpchange(player, hp_change, reason)
local func = core.registered_on_player_hpchanges.modifiers[i]
hp_change, last = func(player, hp_change, reason)
if type(hp_change) ~= "number" then
local debuginfo = debug.getinfo(func)
local debuginfo = debug_getinfo(func)
error("The register_on_hp_changes function has to return a number at " ..
debuginfo.short_src .. " line " .. debuginfo.linedefined)
end
@@ -570,7 +571,7 @@ function core.register_on_player_hpchange(func, modifier)
end
core.callback_origins[func] = {
mod = core.get_current_modname() or "??",
name = debug.getinfo(1, "n").name or "??"
name = debug_getinfo(1, "n").name or "??"
}
end