use GetCommand
This commit is contained in:
@@ -1236,8 +1236,7 @@ void Actor::AddCommand( const RString &sCmdName, apActorCommands apac )
|
|||||||
|
|
||||||
bool Actor::HasCommand( const RString &sCmdName )
|
bool Actor::HasCommand( const RString &sCmdName )
|
||||||
{
|
{
|
||||||
map<RString, apActorCommands>::const_iterator it = m_mapNameToCommands.find( sCmdName );
|
return GetCommand(sCmdName) != NULL;
|
||||||
return it != m_mapNameToCommands.end();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const apActorCommands *Actor::GetCommand( const RString &sCommandName ) const
|
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 )
|
void Actor::PlayCommand( const RString &sCommandName, Actor *pParent )
|
||||||
{
|
{
|
||||||
map<RString, apActorCommands>::const_iterator it = m_mapNameToCommands.find( sCommandName );
|
const apActorCommands *pCmd = GetCommand( sCommandName );
|
||||||
|
if( pCmd != NULL )
|
||||||
if( it == m_mapNameToCommands.end() )
|
RunCommands( *pCmd );
|
||||||
return;
|
|
||||||
|
|
||||||
RunCommands( *it->second );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Actor::HandleMessage( const RString& sMessage )
|
void Actor::HandleMessage( const RString& sMessage )
|
||||||
|
|||||||
Reference in New Issue
Block a user