diff --git a/stepmania/src/Actor.cpp b/stepmania/src/Actor.cpp index b3ad1fce17..df3fde9dc5 100644 --- a/stepmania/src/Actor.cpp +++ b/stepmania/src/Actor.cpp @@ -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 ) diff --git a/stepmania/src/Actor.h b/stepmania/src/Actor.h index cd53fa54f4..d9ab664ecb 100644 --- a/stepmania/src/Actor.h +++ b/stepmania/src/Actor.h @@ -32,6 +32,7 @@ public: void UnsubcribeAndClearCommands(); virtual void Reset(); virtual void LoadFromNode( const CString& sDir, const XNode* pNode ); + bool IsType( const CString &sType ); static void SetBGMTime( float fTime, float fBeat ); static void SetBGMLight( int iLightNumber, float fCabinetLights );