diff --git a/stepmania/src/GameState.cpp b/stepmania/src/GameState.cpp index 51c26ab373..d739058f7b 100644 --- a/stepmania/src/GameState.cpp +++ b/stepmania/src/GameState.cpp @@ -519,6 +519,8 @@ void GameState::FinishStage() if( !m_bMultiplayer ) // no saved stats in multiplayer CommitStageStats(); + RestoreSelectedOptions(); + m_bStatsCommitted = false; // Increment the stage counter. @@ -1039,7 +1041,10 @@ void GameState::ApplyModifiers( PlayerNumber pn, CString sModifiers ) void GameState::StoreSelectedOptions() { FOREACH_PlayerNumber( pn ) + { m_pPlayerState[pn]->m_StoredPlayerOptions = m_pPlayerState[pn]->m_PlayerOptions; + m_pPlayerState[pn]->m_StagePlayerOptions = m_pPlayerState[pn]->m_PlayerOptions; + } m_StoredSongOptions = m_SongOptions; } @@ -1054,6 +1059,13 @@ void GameState::RestoreSelectedOptions() m_SongOptions = m_StoredSongOptions; } +void GameState::RestoreStageOptions() +{ + FOREACH_PlayerNumber( pn ) + m_pPlayerState[pn]->m_PlayerOptions = m_pPlayerState[pn]->m_StagePlayerOptions; + m_SongOptions = m_StoredSongOptions; +} + void GameState::ResetCurrentOptions() { FOREACH_PlayerNumber( p ) @@ -1191,7 +1203,7 @@ void GameState::SetNoteSkinForBeatRange( PlayerState* pPlayerState, const CStrin BeatToNoteSkin[StartBeat] = sNoteSkin; /* Return to the default note skin after the duration. */ - BeatToNoteSkin[EndBeat] = pPlayerState->m_StoredPlayerOptions.m_sNoteSkin; + BeatToNoteSkin[EndBeat] = pPlayerState->m_StagePlayerOptions.m_sNoteSkin; ++m_BeatToNoteSkinRev; } diff --git a/stepmania/src/GameState.h b/stepmania/src/GameState.h index 9b2674312a..22ba1ef969 100644 --- a/stepmania/src/GameState.h +++ b/stepmania/src/GameState.h @@ -222,6 +222,7 @@ public: void ApplyModifiers( PlayerNumber pn, CString sModifiers ); void StoreSelectedOptions(); void RestoreSelectedOptions(); + void RestoreStageOptions(); void ResetCurrentOptions(); bool IsDisqualified( PlayerNumber pn ); diff --git a/stepmania/src/PlayerState.cpp b/stepmania/src/PlayerState.cpp index 4032dac31d..7310659962 100644 --- a/stepmania/src/PlayerState.cpp +++ b/stepmania/src/PlayerState.cpp @@ -57,7 +57,7 @@ void PlayerState::Update( float fDelta ) void PlayerState::RebuildPlayerOptionsFromActiveAttacks() { // rebuild player options - PlayerOptions po = m_StoredPlayerOptions; + PlayerOptions po = m_StagePlayerOptions; for( unsigned s=0; sm_CurrentPlayerOptions = GAMESTATE->m_pPlayerState[PLAYER_1]->m_CurrentPlayerOptions; GetPlayerState()->m_PlayerOptions = GAMESTATE->m_pPlayerState[PLAYER_1]->m_PlayerOptions; + GetPlayerState()->m_StagePlayerOptions = GAMESTATE->m_pPlayerState[PLAYER_1]->m_StagePlayerOptions; GetPlayerState()->m_StoredPlayerOptions = GAMESTATE->m_pPlayerState[PLAYER_1]->m_StoredPlayerOptions; } } @@ -855,6 +856,7 @@ void ScreenGameplay::Init() void ScreenGameplay::InitSongQueues() { LOG->Trace("InitSongQueues"); + if( GAMESTATE->IsCourseMode() ) { Course* pCourse = GAMESTATE->m_pCurCourse; @@ -882,14 +884,16 @@ void ScreenGameplay::InitSongQueues() ASSERT( e->pSteps ); pi->m_vpStepsQueue.push_back( e->pSteps ); AttackArray a; - - // In a survuval course, override stored mods - if( pCourse->GetCourseType() == COURSE_TYPE_SURVIVAL ) - a.push_back( Attack(ATTACK_LEVEL_1, 0, 0, "clearall,"+CommonMetrics::DEFAULT_MODIFIERS.GetValue(), false, true, false) ); // don't show in AttackList - e->GetAttackArray( a ); pi->m_asModifiersQueue.push_back( a ); } + + // In a survuval course, override stored mods + if( pCourse->GetCourseType() == COURSE_TYPE_SURVIVAL ) + { + pi->GetPlayerState()->m_StagePlayerOptions.FromString( "clearall,"+CommonMetrics::DEFAULT_MODIFIERS.GetValue(), true ); + pi->GetPlayerState()->RebuildPlayerOptionsFromActiveAttacks(); + } } } else @@ -901,10 +905,13 @@ void ScreenGameplay::InitSongQueues() pi->m_vpStepsQueue.push_back( pSteps ); AttackArray aa; - if( pSteps->GetDifficulty() == DIFFICULTY_BEGINNER && (bool)USE_FORCED_MODIFIERS_IN_BEGINNER ) - aa.push_back( Attack(ATTACK_LEVEL_1, 0, 0, FORCED_MODIFIERS_IN_BEGINNER, false, true, false) ); // don't show in AttackList - pi->m_asModifiersQueue.push_back( aa ); + + if( pSteps->GetDifficulty() == DIFFICULTY_BEGINNER && (bool)USE_FORCED_MODIFIERS_IN_BEGINNER ) + { + pi->GetPlayerState()->m_StagePlayerOptions.FromString( FORCED_MODIFIERS_IN_BEGINNER, true ); + pi->GetPlayerState()->RebuildPlayerOptionsFromActiveAttacks(); + } } } @@ -1055,8 +1062,7 @@ void ScreenGameplay::LoadNextSong() // No need to do this here. We do it in SongFinished(). //GAMESTATE->RemoveAllActiveAttacks(); - // Restore the player's originally selected options. - GAMESTATE->RestoreSelectedOptions(); + GAMESTATE->RestoreStageOptions(); /* If we're in battery mode, force FailImmediate. We assume in PlayerMinus::Step that * failed players can't step. */ @@ -2271,7 +2277,7 @@ void ScreenGameplay::StageFinished( bool bBackedOut ) STATSMAN->m_vPlayedStageStats.push_back( STATSMAN->m_CurStageStats ); /* Reset options. */ - GAMESTATE->RestoreSelectedOptions(); + GAMESTATE->RestoreStageOptions(); } void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM )