From 35e1580fa34d2d416f0674133402495d9e2167d7 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Fri, 14 Mar 2003 22:55:06 +0000 Subject: [PATCH] fix random/roulette hang; add an assert to catch this in the future --- stepmania/src/MusicWheel.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/stepmania/src/MusicWheel.cpp b/stepmania/src/MusicWheel.cpp index e36da649e8..78b81585b4 100644 --- a/stepmania/src/MusicWheel.cpp +++ b/stepmania/src/MusicWheel.cpp @@ -298,6 +298,9 @@ void MusicWheel::BuildWheelItemDatas( vector &arrayWheelItemDatas unsigned i; // 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) ) { switch( GAMESTATE->m_PlayMode ) @@ -305,9 +308,9 @@ void MusicWheel::BuildWheelItemDatas( vector &arrayWheelItemDatas case PLAY_MODE_NONSTOP: case PLAY_MODE_ONI: case PLAY_MODE_ENDLESS: - break; - default: return; + default: + break; } } @@ -525,6 +528,8 @@ void MusicWheel::RebuildWheelItemDisplays() m_iSelection = 0; iIndex -= NUM_WHEEL_ITEMS_TO_DRAW/2; + + ASSERT(m_CurWheelItemData.size()); while(iIndex < 0) iIndex += m_CurWheelItemData.size();