From ccfa2f16dd287d284680bb72dc419f479d510801 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Wed, 11 Oct 2006 23:56:00 +0000 Subject: [PATCH] bOptional always true --- stepmania/src/LuaBinding.cpp | 5 ++--- stepmania/src/LuaBinding.h | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/stepmania/src/LuaBinding.cpp b/stepmania/src/LuaBinding.cpp index 8618697c9f..5ad5bfcade 100644 --- a/stepmania/src/LuaBinding.cpp +++ b/stepmania/src/LuaBinding.cpp @@ -220,11 +220,10 @@ bool LuaBinding::Equal( lua_State *L ) * Get a userdata, and check that it's either szType or a type * 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( bOptional ) - return true; + return true; #endif /* Check that szType is in metatable.heirarchy. */ diff --git a/stepmania/src/LuaBinding.h b/stepmania/src/LuaBinding.h index c14bb12f52..110aa74cf0 100644 --- a/stepmania/src/LuaBinding.h +++ b/stepmania/src/LuaBinding.h @@ -19,7 +19,7 @@ public: virtual const RString &GetClassName() 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 ); protected: @@ -70,7 +70,7 @@ public: // Get userdata from the Lua stack and return a pointer to T object. 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 ) luaL_typerror( L, narg, m_sClassName );