diff --git a/stepmania/src/Actor.cpp b/stepmania/src/Actor.cpp index d90e08b914..c229f2b0ac 100644 --- a/stepmania/src/Actor.cpp +++ b/stepmania/src/Actor.cpp @@ -1240,11 +1240,12 @@ bool Actor::HasCommand( const RString &sCmdName ) return it != m_mapNameToCommands.end(); } -const apActorCommands& Actor::GetCommand( const RString &sCommandName ) const +const apActorCommands *Actor::GetCommand( const RString &sCommandName ) const { map::const_iterator it = m_mapNameToCommands.find( sCommandName ); - ASSERT( it != m_mapNameToCommands.end() ); - return it->second; + if( it == m_mapNameToCommands.end() ) + return NULL; + return &it->second; } void Actor::PlayCommand( const RString &sCommandName, Actor *pParent ) diff --git a/stepmania/src/Actor.h b/stepmania/src/Actor.h index 2487cb3fc1..9d1c69d7af 100644 --- a/stepmania/src/Actor.h +++ b/stepmania/src/Actor.h @@ -332,7 +332,7 @@ public: // void AddCommand( const RString &sCmdName, apActorCommands apac ); bool HasCommand( const RString &sCmdName ); - const apActorCommands& GetCommand( const RString &sCommandName ) const; + const apActorCommands *GetCommand( const RString &sCommandName ) const; virtual void PlayCommand( const RString &sCommandName, Actor *pParent = NULL ); virtual void RunCommands( const LuaReference& cmds, Actor *pParent = NULL ); void RunCommands( const apActorCommands& cmds, Actor *pParent = NULL ) { this->RunCommands( *cmds, pParent ); } // convenience