From cec1abf53b003b53eebbaab436df4416dfae7699 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Wed, 4 May 2005 10:49:31 +0000 Subject: [PATCH] fix double-loaded commands --- stepmania/src/DifficultyMeter.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/stepmania/src/DifficultyMeter.cpp b/stepmania/src/DifficultyMeter.cpp index 65c3998de2..8869ec8c4b 100644 --- a/stepmania/src/DifficultyMeter.cpp +++ b/stepmania/src/DifficultyMeter.cpp @@ -89,11 +89,12 @@ void DifficultyMeter::Load( const CString &sType ) ActorUtil::SetXYAndOnCommand( m_Difficulty, sType ); this->AddChild( m_Difficulty ); + // These commands should have been loaded by SetXYAndOnCommand above. FOREACH_Difficulty( d ) - ActorUtil::LoadCommand( *m_Difficulty, sType, GetDifficultyCommandName(d) ); + ASSERT( m_Difficulty->HasCommand(GetDifficultyCommandName(d)) ); FOREACH_CourseDifficulty( d ) - ActorUtil::LoadCommand( *m_Difficulty, sType, GetCourseDifficultyCommandName(d) ); - ActorUtil::LoadCommand( *m_Difficulty, sType, DIFFICULTY_COMMAND_NAME_NONE ); + ASSERT( m_Difficulty->HasCommand(GetCourseDifficultyCommandName(d)) ); + ASSERT( m_Difficulty->HasCommand(DIFFICULTY_COMMAND_NAME_NONE) ); } if( m_bShowMeter ) @@ -103,11 +104,12 @@ void DifficultyMeter::Load( const CString &sType ) ActorUtil::SetXYAndOnCommand( m_textMeter, sType ); this->AddChild( &m_textMeter ); + // These commands should have been loaded by SetXYAndOnCommand above. FOREACH_Difficulty( d ) - ActorUtil::LoadCommand( m_textMeter, sType, GetDifficultyCommandName(d) ); + ASSERT( m_textMeter.HasCommand(GetDifficultyCommandName(d)) ); FOREACH_CourseDifficulty( d ) - ActorUtil::LoadCommand( m_textMeter, sType, GetCourseDifficultyCommandName(d) ); - ActorUtil::LoadCommand( m_textMeter, sType, DIFFICULTY_COMMAND_NAME_NONE ); + ASSERT( m_textMeter.HasCommand(GetCourseDifficultyCommandName(d)) ); + ASSERT( m_textMeter.HasCommand(DIFFICULTY_COMMAND_NAME_NONE) ); } if( m_bShowEditDescription )