From 3943a06255274dcf4a64e8ab5e679a9ac989d75e Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sun, 26 Mar 2006 06:02:37 +0000 Subject: [PATCH] use GetCommand --- stepmania/src/Actor.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/stepmania/src/Actor.cpp b/stepmania/src/Actor.cpp index c229f2b0ac..058e6fd7d9 100644 --- a/stepmania/src/Actor.cpp +++ b/stepmania/src/Actor.cpp @@ -1236,8 +1236,7 @@ void Actor::AddCommand( const RString &sCmdName, apActorCommands apac ) bool Actor::HasCommand( const RString &sCmdName ) { - map::const_iterator it = m_mapNameToCommands.find( sCmdName ); - return it != m_mapNameToCommands.end(); + return GetCommand(sCmdName) != NULL; } const apActorCommands *Actor::GetCommand( const RString &sCommandName ) const @@ -1250,12 +1249,9 @@ const apActorCommands *Actor::GetCommand( const RString &sCommandName ) const void Actor::PlayCommand( const RString &sCommandName, Actor *pParent ) { - map::const_iterator it = m_mapNameToCommands.find( sCommandName ); - - if( it == m_mapNameToCommands.end() ) - return; - - RunCommands( *it->second ); + const apActorCommands *pCmd = GetCommand( sCommandName ); + if( pCmd != NULL ) + RunCommands( *pCmd ); } void Actor::HandleMessage( const RString& sMessage )