From e7db8576b8a4988dfdd206500199e59c3b57bf55 Mon Sep 17 00:00:00 2001 From: Nicolas Noble Date: Tue, 30 Jul 2013 19:10:20 -0700 Subject: Changing things a bit in the Lua binding system. Now pushing a class template means pushing a table by its name, and the constructor is implicit in it. --- src/BLua.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/BLua.cc') diff --git a/src/BLua.cc b/src/BLua.cc index 62e4010..cb0e645 100644 --- a/src/BLua.cc +++ b/src/BLua.cc @@ -382,6 +382,8 @@ void Balau::Lua::declareFunc(const char * name, lua_CFunction f, int i) { checkstack(2); lua_pushstring(L, name); lua_pushcfunction(L, f); + if ((i < 0) && (i > LUA_REGISTRYINDEX)) + i += 2; lua_settable(L, i); } -- cgit v1.2.3