bOptional always true

This commit is contained in:
Glenn Maynard
2006-10-11 23:56:00 +00:00
parent 6ff22acb45
commit ccfa2f16dd
2 changed files with 4 additions and 5 deletions
+1 -2
View File
@@ -220,10 +220,9 @@ bool LuaBinding::Equal( lua_State *L )
* Get a userdata, and check that it's either szType or a type * Get a userdata, and check that it's either szType or a type
* derived from szType, by walking the __index chain. * derived from szType, by walking the __index chain.
*/ */
bool LuaBinding::CheckLuaObjectType( lua_State *L, int iArg, const char *szType, bool bOptional ) bool LuaBinding::CheckLuaObjectType( lua_State *L, int iArg, const char *szType )
{ {
#if defined(FAST_LUA) #if defined(FAST_LUA)
if( bOptional )
return true; return true;
#endif #endif
+2 -2
View File
@@ -19,7 +19,7 @@ public:
virtual const RString &GetClassName() const = 0; virtual const RString &GetClassName() const = 0;
virtual const RString &GetBaseClassName() const = 0; virtual const RString &GetBaseClassName() const = 0;
static bool CheckLuaObjectType( lua_State *L, int narg, const char *szType, bool bOptional=false ); static bool CheckLuaObjectType( lua_State *L, int narg, const char *szType );
static void ApplyDerivedType( Lua *L, const RString &sClassname, void *pSelf ); static void ApplyDerivedType( Lua *L, const RString &sClassname, void *pSelf );
protected: protected:
@@ -70,7 +70,7 @@ public:
// Get userdata from the Lua stack and return a pointer to T object. // Get userdata from the Lua stack and return a pointer to T object.
static T *check( lua_State *L, int narg, bool bIsSelf = false ) static T *check( lua_State *L, int narg, bool bIsSelf = false )
{ {
if( !LuaBinding::CheckLuaObjectType(L, narg, m_sClassName, true) ) if( !LuaBinding::CheckLuaObjectType(L, narg, m_sClassName) )
{ {
if( bIsSelf ) if( bIsSelf )
luaL_typerror( L, narg, m_sClassName ); luaL_typerror( L, narg, m_sClassName );