util.debug: Adjust level within get_locals_table() to account for the additional depth of this function itself
authorMatthew Wild <mwild1@gmail.com>
Fri, 13 Jan 2012 15:46:36 +0000
changeset 4465 41c4252526bd
parent 4464 b0574fc78a0a
child 4466 28e0bf9cf0f5
util.debug: Adjust level within get_locals_table() to account for the additional depth of this function itself
util/debug.lua
--- a/util/debug.lua	Fri Jan 06 21:45:33 2012 +0000
+++ b/util/debug.lua	Fri Jan 13 15:46:36 2012 +0000
@@ -9,6 +9,7 @@
 };
 
 local function get_locals_table(level)
+	level = level + 1; -- Skip this function itself
 	local locals = {};
 	for local_num = 1, math.huge do
 		local name, value = debug.getlocal(level, local_num);