From 9793a08b165ef7140905b4a2c676b1cb11057eeb Mon Sep 17 00:00:00 2001 From: AJ Kelly Date: Sun, 6 Nov 2011 16:44:23 -0600 Subject: [PATCH] [ScreenSelectMusic] Fixed Rave difficulties not being synced on late join. Fixes issue 577. --- Docs/Changelog_sm5.txt | 2 ++ src/ScreenSelectMusic.cpp | 10 +++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Docs/Changelog_sm5.txt b/Docs/Changelog_sm5.txt index 47c502f7ec..539774b567 100644 --- a/Docs/Changelog_sm5.txt +++ b/Docs/Changelog_sm5.txt @@ -12,6 +12,8 @@ StepMania 5.0 $next | 2011xxxx ---------- * [GameState] Add the RefreshNoteSkinData lua binding. This will only refresh the NS data for the present game, not all games. [Wolfman2000] +* [ScreenSelectMusic] Fixed Rave difficulties not being synced on late join. + Fixes issue 577. [AJ] 2011/11/04 * [ScoreKeeperRave] Revert fix from 2011/10/28. [AJ] diff --git a/src/ScreenSelectMusic.cpp b/src/ScreenSelectMusic.cpp index 128527331f..6e7e55698c 100644 --- a/src/ScreenSelectMusic.cpp +++ b/src/ScreenSelectMusic.cpp @@ -1044,12 +1044,13 @@ void ScreenSelectMusic::HandleMessage( const Message &msg ) { if( m_bRunning && msg == Message_PlayerJoined ) { + PlayerNumber master_pn = GAMESTATE->GetMasterPlayerNumber(); // 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 StepsDisplayList. - GAMESTATE->m_pCurSteps[GAMESTATE->GetMasterPlayerNumber()].SetWithoutBroadcast( NULL ); + GAMESTATE->m_pCurSteps[master_pn].SetWithoutBroadcast( NULL ); FOREACH_ENUM( PlayerNumber, p ) GAMESTATE->m_pCurSteps[p].SetWithoutBroadcast( NULL ); @@ -1079,9 +1080,12 @@ void ScreenSelectMusic::HandleMessage( const Message &msg ) } else { - // todo: handle changing rave difficulty on join -aj - Steps* pSteps = m_vpSteps.empty()? NULL: m_vpSteps[m_iSelection[pn]]; + + // handle changing rave difficulty on join + if(GAMESTATE->m_PlayMode == PLAY_MODE_RAVE) + pSteps = m_vpSteps[m_iSelection[master_pn]]; + GAMESTATE->m_pCurSteps[pn].Set( pSteps ); } }