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:
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user