From 635b66a8c639f79aabe19501153e21e3dfcb9be6 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Sat, 26 Jul 2025 22:50:35 +0300 Subject: [PATCH] fix debug.getinfo --- res/scripts/stdlib.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/res/scripts/stdlib.lua b/res/scripts/stdlib.lua index ce036a48..aea785ac 100644 --- a/res/scripts/stdlib.lua +++ b/res/scripts/stdlib.lua @@ -535,8 +535,11 @@ local _getinfo = debug.getinfo for i, name in ipairs(removed_names) do debug[name] = nil end -debug.getinfo = function(...) - local debuginfo = _getinfo(...) +debug.getinfo = function(lvl, fields) + if type(lvl) == "number" then + lvl = lvl + 1 + end + local debuginfo = _getinfo(lvl, fields) debuginfo.func = nil return debuginfo end