From f62ed09cd34a1a07ac0a33e5101f72896cf6bddf Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Wed, 7 Jul 2004 20:01:22 +0000 Subject: [PATCH] give an error message instead of an assertion if ScreenSelectDifficulty metrics are wrong --- stepmania/src/ScreenSelectDifficulty.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/stepmania/src/ScreenSelectDifficulty.cpp b/stepmania/src/ScreenSelectDifficulty.cpp index 1596a7a683..aca4b535ea 100644 --- a/stepmania/src/ScreenSelectDifficulty.cpp +++ b/stepmania/src/ScreenSelectDifficulty.cpp @@ -286,7 +286,8 @@ void ScreenSelectDifficulty::ChangePage( Page newPage ) // Find the first Playable mode on the new page int iSwitchToIndex = -1; - if( !bPageIncreasing ) { + if( !bPageIncreasing ) + { for( int i=m_ModeChoices[newPage].size()-1; i>=0; i-- ) { if( m_ModeChoices[newPage][i].IsPlayable() ) @@ -305,7 +306,8 @@ void ScreenSelectDifficulty::ChangePage( Page newPage ) } } } - ASSERT( iSwitchToIndex != -1 ); + if( iSwitchToIndex == -1 ) + RageException::Throw( "%s has no selectable choices on page %i", m_sName.c_str(), newPage); // change both players FOREACH_PlayerNumber( p )