fix OnCommand sometimes run twice

This commit is contained in:
Glenn Maynard
2005-10-18 03:35:00 +00:00
parent 4f959ce9b9
commit ae654aaf9b
2 changed files with 12 additions and 0 deletions
+11
View File
@@ -63,6 +63,17 @@ bool Transition::EarlyAbortDraw() const
return m_State == waiting;
}
/* Our parent might send us OnCommand. We do that ourself, because
* we sometimes want to know GetLengthSeconds before StartTransitioning.
* Make sure we don't process OnCommand twice. */
void Transition::PlayCommand( const CString &sCommandName, Actor *pParent )
{
if( sCommandName == "On" )
return;
ActorFrame::PlayCommand( sCommandName, pParent );
}
void Transition::StartTransitioning( ScreenMessage send_when_done )
{
if( m_State != waiting )
+1
View File
@@ -16,6 +16,7 @@ public:
void Load( CString sBGAniDir );
virtual void UpdateInternal( float fDeltaTime );
virtual void PlayCommand( const CString &sCommandName, Actor *pParent = NULL );
virtual void StartTransitioning( ScreenMessage send_when_done = SM_None );
virtual bool EarlyAbortDraw() const;