From b4348d5503e3718bbb6d1a3b7109f049908d5625 Mon Sep 17 00:00:00 2001 From: pixel Date: Fri, 27 Feb 2004 10:35:44 +0000 Subject: Eww.... functions != methods --- include/BLua.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/BLua.h b/include/BLua.h index 0f76284..dc2d963 100644 --- a/include/BLua.h +++ b/include/BLua.h @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Id: BLua.h,v 1.12 2003-12-26 20:36:07 pixel Exp $ */ +/* $Id: BLua.h,v 1.13 2004-02-27 10:35:44 pixel Exp $ */ #ifndef __BLUA_H__ #define __BLUA_H__ @@ -182,10 +182,13 @@ class LuaHelpers : public Base { Lua * L = Lua::find(_L); int add = method ? 1 : 0; int n = L->gettop() - add; - T * obj = (T *) LuaObject::getme(L); + T * obj = 0; int i; bool invalid = false; + if (method) + obj = (T *) LuaObject::getme(L); + if ((n < tab[caller].minargs) || (n > tab[caller].maxargs)) { invalid = true; } else { -- cgit v1.2.3