Changeset

4693:7ef4faa056fb

util.debug: Some more magic constant fiddling. Don't ask me.
author Matthew Wild <mwild1@gmail.com>
date Wed, 25 Apr 2012 23:16:37 +0100
parents 4692:8e7c683d78ca
children 4694:f9a091b6dfd5
files util/debug.lua
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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;