Previously, BeginStage was called in SGameplay and FinishStage was called
in each place gameplay exits. This incremented the stage number in SSM, and was brittle: FinishStage was sprinkled in many odd places. Do both in SGameplay. This increments the stage number as soon as gameplay ends. This only affects evaluation. Use the stage number from StageStats there, instead of the current stage, and adjust branches. During evaluation, the game is on the upcoming stage and displaying old data for the last stage, instead of the stage continuing through evaluation. This also moves a bunch of scoring-related stuff out of SEvaluation, to the end of gameplay, where it belongs. Eval is almost const, and things won't break like they would before if Eval is not used.
This commit is contained in:
@@ -385,10 +385,6 @@ void ScreenGameplay::Init()
|
||||
GAMESTATE->SaveCurrentSettingsToProfile(pn);
|
||||
}
|
||||
|
||||
/* Finish the last stage, if we havn't already. (For example, we might have
|
||||
* gone from gameplay to evaluation back to gameplay.) */
|
||||
GAMESTATE->FinishStage();
|
||||
|
||||
/* Called once per stage (single song or single course). */
|
||||
GAMESTATE->BeginStage();
|
||||
|
||||
@@ -2240,9 +2236,22 @@ void ScreenGameplay::StageFinished( bool bBackedOut )
|
||||
}
|
||||
}
|
||||
|
||||
if( bBackedOut )
|
||||
{
|
||||
GAMESTATE->CancelStage();
|
||||
return;
|
||||
}
|
||||
|
||||
// save current stage stats
|
||||
if( !bBackedOut )
|
||||
STATSMAN->m_vPlayedStageStats.push_back( STATSMAN->m_CurStageStats );
|
||||
STATSMAN->m_vPlayedStageStats.push_back( STATSMAN->m_CurStageStats );
|
||||
|
||||
GAMESTATE->CommitStageStats();
|
||||
STATSMAN->m_CurStageStats.CommitScores( false );
|
||||
FOREACH_HumanPlayer( pn )
|
||||
STATSMAN->m_CurStageStats.m_player[pn].CalcAwards( pn, STATSMAN->m_CurStageStats.m_bGaveUp, STATSMAN->m_CurStageStats.m_bUsedAutoplay );
|
||||
|
||||
STATSMAN->CalcAccumPlayedStageStats();
|
||||
GAMESTATE->FinishStage();
|
||||
}
|
||||
|
||||
void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM )
|
||||
@@ -2442,8 +2451,6 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM )
|
||||
SongFinished();
|
||||
StageFinished( true );
|
||||
|
||||
GAMESTATE->CancelStage();
|
||||
|
||||
m_sNextScreen = GetPrevScreen();
|
||||
|
||||
if( AdjustSync::IsSyncDataChanged() )
|
||||
|
||||
Reference in New Issue
Block a user