Propagate commands to BGAs.

This commit is contained in:
Glenn Maynard
2003-10-31 02:01:16 +00:00
parent 8e9e04e221
commit e67e2378fd
+9 -3
View File
@@ -143,13 +143,19 @@ void UtilSetXY( Actor& actor, CString sClassName )
float UtilCommand( Actor& actor, CString sClassName, CString sCommandName )
{
ASSERT( !actor.GetName().empty() );
actor.Command( "playcommand," + sCommandName );
// HACK: It's very often that we command things to TweenOffScreen
// that we aren't drawing. We know that an Actor is not being
// used if it's name is blank. So, do nothing on Actors with a blank name.
if( sCommandName=="Off" && actor.GetName().empty() )
return 0;
// (Do "playcommand" anyway; BGAs often have no name.)
if( sCommandName=="Off" )
{
if( actor.GetName().empty() )
return 0;
} else {
ASSERT( !actor.GetName().empty() );
}
return actor.Command( THEME->GetMetric(sClassName,actor.GetName()+sCommandName+"Command") );
}