From 169deb9ca6cd622b09f2b186cc605be034a8a44a Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Wed, 25 Apr 2012 23:16:37 +0100 Subject: util.debug: Some more magic constant fiddling. Don't ask me. --- util/debug.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/util/debug.lua b/util/debug.lua index 7caf21ce..16773cd1 100644 --- a/util/debug.lua +++ b/util/debug.lua @@ -88,9 +88,9 @@ function get_traceback_table(thread, start_level) for level = start_level, math.huge do local info; if thread then - info = debug.getinfo(thread, level); + info = debug.getinfo(thread, level+1); else - info = debug.getinfo(level); + info = debug.getinfo(level+1); end if not info then break; end @@ -128,13 +128,13 @@ function _traceback(thread, message, level) if type(message) == "number" then level, message = message, nil; else - level = 2; + level = 1; end end message = message and (message.."\n") or ""; - local levels = get_traceback_table(thread, level+2); + local levels = get_traceback_table(thread, level+3); local last_source_desc; -- cgit v1.2.3