simplify - less state is better
This commit is contained in:
@@ -196,7 +196,6 @@ void GameState::Reset()
|
|||||||
m_bDemonstrationOrJukebox = false;
|
m_bDemonstrationOrJukebox = false;
|
||||||
m_bJukeboxUsesModifiers = false;
|
m_bJukeboxUsesModifiers = false;
|
||||||
m_iCurrentStageIndex = 0;
|
m_iCurrentStageIndex = 0;
|
||||||
m_bAllow2ndExtraStage = true;
|
|
||||||
m_BeatToNoteSkinRev = 0;
|
m_BeatToNoteSkinRev = 0;
|
||||||
m_iNumStagesOfThisSong = 0;
|
m_iNumStagesOfThisSong = 0;
|
||||||
|
|
||||||
@@ -921,6 +920,18 @@ bool GameState::HasEarnedExtraStage() const
|
|||||||
if( m_bBackedOutOfFinalStage )
|
if( m_bBackedOutOfFinalStage )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
/* If PickExtraStage, allow EX2 if the chosen song was correct. */
|
||||||
|
if( PREFSMAN->m_bPickExtraStage && this->IsExtraStage() )
|
||||||
|
{
|
||||||
|
Song* pSong;
|
||||||
|
Steps* pSteps;
|
||||||
|
SONGMAN->GetExtraStageInfo( false, GAMESTATE->GetCurrentStyle(), pSong, pSteps, NULL, NULL );
|
||||||
|
ASSERT(pSong);
|
||||||
|
|
||||||
|
const StageStats &stats = STATSMAN->m_CurStageStats;
|
||||||
|
return stats.vpPlayedSongs.size() && stats.vpPlayedSongs.back() == pSong;
|
||||||
|
}
|
||||||
|
|
||||||
if( (this->IsFinalStage() || this->IsExtraStage()) )
|
if( (this->IsFinalStage() || this->IsExtraStage()) )
|
||||||
{
|
{
|
||||||
FOREACH_EnabledPlayer( pn )
|
FOREACH_EnabledPlayer( pn )
|
||||||
@@ -929,11 +940,6 @@ bool GameState::HasEarnedExtraStage() const
|
|||||||
this->m_pCurSteps[pn]->GetDifficulty() != DIFFICULTY_CHALLENGE )
|
this->m_pCurSteps[pn]->GetDifficulty() != DIFFICULTY_CHALLENGE )
|
||||||
continue; /* not hard enough! */
|
continue; /* not hard enough! */
|
||||||
|
|
||||||
/* If "choose EX" is enabled, then we should only grant EX2 if the chosen
|
|
||||||
* stage was the EX we would have chosen (m_bAllow2ndExtraStage is true). */
|
|
||||||
if( PREFSMAN->m_bPickExtraStage && this->IsExtraStage() && !this->m_bAllow2ndExtraStage )
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if( STATSMAN->m_CurStageStats.m_player[pn].GetGrade() <= Grade_Tier03 )
|
if( STATSMAN->m_CurStageStats.m_player[pn].GetGrade() <= Grade_Tier03 )
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -230,7 +230,6 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
bool HasEarnedExtraStage() const;
|
bool HasEarnedExtraStage() const;
|
||||||
bool m_bAllow2ndExtraStage; //only used when "Allow Selection of Extra Stage is on"
|
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -1243,21 +1243,6 @@ void ScreenSelectMusic::MenuStart( PlayerNumber pn )
|
|||||||
StartTransitioning( SM_BeginFadingOut );
|
StartTransitioning( SM_BeginFadingOut );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( GAMESTATE->IsExtraStage() && PREFSMAN->m_bPickExtraStage )
|
|
||||||
{
|
|
||||||
/* Check if user selected the real extra stage. */
|
|
||||||
Song* pSong;
|
|
||||||
Steps* pSteps;
|
|
||||||
SONGMAN->GetExtraStageInfo( false, GAMESTATE->GetCurrentStyle(), pSong, pSteps, NULL, NULL );
|
|
||||||
ASSERT(pSong);
|
|
||||||
|
|
||||||
/* Enable 2nd extra stage if user chose the correct song */
|
|
||||||
if( m_MusicWheel.GetSelectedSong() == pSong )
|
|
||||||
GAMESTATE->m_bAllow2ndExtraStage = true;
|
|
||||||
else
|
|
||||||
GAMESTATE->m_bAllow2ndExtraStage = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user