fix random/roulette hang; add an assert to catch this in the future

This commit is contained in:
Glenn Maynard
2003-03-14 22:55:06 +00:00
parent d10fe90b95
commit 35e1580fa3
+7 -2
View File
@@ -298,6 +298,9 @@ void MusicWheel::BuildWheelItemDatas( vector<WheelItemData> &arrayWheelItemDatas
unsigned i; unsigned i;
// Roulette isn't a choice when selecting a course // Roulette isn't a choice when selecting a course
/* Do we really need to do this? Seems like an optimization that
* doesn't win anything. (And the other sort orders aren't used,
* either ...) -glenn */
if( so == SongSortOrder(SORT_ROULETTE) ) if( so == SongSortOrder(SORT_ROULETTE) )
{ {
switch( GAMESTATE->m_PlayMode ) switch( GAMESTATE->m_PlayMode )
@@ -305,9 +308,9 @@ void MusicWheel::BuildWheelItemDatas( vector<WheelItemData> &arrayWheelItemDatas
case PLAY_MODE_NONSTOP: case PLAY_MODE_NONSTOP:
case PLAY_MODE_ONI: case PLAY_MODE_ONI:
case PLAY_MODE_ENDLESS: case PLAY_MODE_ENDLESS:
break;
default:
return; return;
default:
break;
} }
} }
@@ -525,6 +528,8 @@ void MusicWheel::RebuildWheelItemDisplays()
m_iSelection = 0; m_iSelection = 0;
iIndex -= NUM_WHEEL_ITEMS_TO_DRAW/2; iIndex -= NUM_WHEEL_ITEMS_TO_DRAW/2;
ASSERT(m_CurWheelItemData.size());
while(iIndex < 0) while(iIndex < 0)
iIndex += m_CurWheelItemData.size(); iIndex += m_CurWheelItemData.size();