From 13231a31dccfcc37b2acf8038f2734331d9c2abe Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Thu, 8 Mar 2007 04:47:47 +0000 Subject: [PATCH] fix crash when double selected and 2nd player joins --- stepmania/src/ScreenSelectMusic.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/stepmania/src/ScreenSelectMusic.cpp b/stepmania/src/ScreenSelectMusic.cpp index ccd692b61e..aced40a85a 100644 --- a/stepmania/src/ScreenSelectMusic.cpp +++ b/stepmania/src/ScreenSelectMusic.cpp @@ -315,7 +315,14 @@ void ScreenSelectMusic::Input( const InputEventPlus &input ) // Handle late joining if( m_SelectionState != SelectionState_Finalized && input.MenuI == MENU_BUTTON_START && input.type == IET_FIRST_PRESS && GAMESTATE->JoinInput(input.pn) ) { - // refresh the steps list so that 2-side StepsTypes will be removed since they're no longer playable + // The current steps may no longer be playable. If one player has double steps + // selected, they are no longer playable now that P2 has joined. + + // TODO: Invalidate the CurSteps only if they are no longer playable. That way, + // after music change will clamp to the nearest in the DifficultyList. + FOREACH_ENUM( PlayerNumber, p ) + GAMESTATE->m_pCurSteps[p].Set( NULL ); + AfterMusicChange(); int iSel = 0;