# HG changeset patch # User Matthew Wild # Date 1335392197 -3600 # Node ID 7ef4faa056fb4ef77002b3fc5001d63de8ac1f4b # Parent 8e7c683d78ca595a5c9dafff9a37d155ced8d9f2 util.debug: Some more magic constant fiddling. Don't ask me. diff -r 8e7c683d78ca -r 7ef4faa056fb util/debug.lua --- a/util/debug.lua Wed Apr 25 23:10:32 2012 +0100 +++ b/util/debug.lua Wed Apr 25 23:16:37 2012 +0100 @@ -88,9 +88,9 @@ 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 @@ 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;