add PlayCommandNoRecurse to fix PlayCommand hack

This commit is contained in:
Glenn Maynard
2007-02-10 05:42:25 +00:00
parent 5e549c0437
commit fcf121feb0
4 changed files with 11 additions and 8 deletions
+8 -1
View File
@@ -233,7 +233,9 @@ void Actor::LoadFromNode( const XNode* pNode )
LUA->Release( L );
PlayCommand( "Init" );
// Don't recurse Init. It gets called once for every Actor when the
// Actor is loaded, and we don't want to call it again.
PlayCommandNoRecurse( Message("Init") );
}
void Actor::Draw()
@@ -1153,6 +1155,11 @@ const apActorCommands *Actor::GetCommand( const RString &sCommandName ) const
}
void Actor::HandleMessage( const Message &msg )
{
PlayCommandNoRecurse( msg );
}
void Actor::PlayCommandNoRecurse( const Message &msg )
{
const apActorCommands *pCmd = GetCommand( msg.GetName() );
if( pCmd != NULL )