Actor::IsType

This commit is contained in:
Glenn Maynard
2005-10-10 21:52:04 +00:00
parent a69244f41f
commit 0f17b0f9c2
2 changed files with 14 additions and 0 deletions
+13
View File
@@ -269,6 +269,19 @@ void Actor::LoadFromNode( const CString& sDir, const XNode* pNode )
PlayCommand( "Init" );
}
/* Like RTTI: return true if this actor is an sType (or derived from sType).
* This uses the Lua binding check, so only works on bound types. */
bool Actor::IsType( const CString &sType )
{
Lua *L = LUA->Get();
this->PushSelf( L );
bool bRet = CheckLuaObjectType( L, -1, sType, false );
lua_pop( L, 1 );
LUA->Release( L );
return bRet;
}
void Actor::Draw()
{
if( !m_bVisible )