From d2bb74c4095c25c8003b91061a9d344812904557 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Mon, 24 May 2004 01:32:17 +0000 Subject: [PATCH] Add step totals in GameState::FinishStage, instead of eval. This means that step counts and "calories" still count if you fail (or give up). --- stepmania/src/GameState.cpp | 15 +++++++++++++++ stepmania/src/ScreenEvaluation.cpp | 14 -------------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/stepmania/src/GameState.cpp b/stepmania/src/GameState.cpp index f5ca29368c..900313373a 100644 --- a/stepmania/src/GameState.cpp +++ b/stepmania/src/GameState.cpp @@ -628,6 +628,21 @@ void GameState::FinishStage() m_iCurrentStageIndex += m_iNumStagesOfThisSong; m_iNumStagesOfThisSong = 0; + + // + // Add step totals. Use fRadarActual, since the player might have failed partway + // through the song, in which case we don't want to give credit for the rest of the + // song. + // + FOREACH_HumanPlayer( pn ) + { + int iNumTapsAndHolds = (int) g_CurStageStats.fRadarActual[pn][RADAR_NUM_TAPS_AND_HOLDS]; + int iNumJumps = (int) g_CurStageStats.fRadarActual[pn][RADAR_NUM_JUMPS]; + int iNumHolds = (int) g_CurStageStats.fRadarActual[pn][RADAR_NUM_HOLDS]; + int iNumMines = (int) g_CurStageStats.fRadarActual[pn][RADAR_NUM_MINES]; + int iNumHands = (int) g_CurStageStats.fRadarActual[pn][RADAR_NUM_HANDS]; + PROFILEMAN->AddStepTotals( pn, iNumTapsAndHolds, iNumJumps, iNumHolds, iNumMines, iNumHands ); + } } int GameState::GetStageIndex() const diff --git a/stepmania/src/ScreenEvaluation.cpp b/stepmania/src/ScreenEvaluation.cpp index f6ca8541b6..8568b51389 100644 --- a/stepmania/src/ScreenEvaluation.cpp +++ b/stepmania/src/ScreenEvaluation.cpp @@ -884,20 +884,6 @@ void ScreenEvaluation::CommitScores( Song* pSong = GAMESTATE->m_pCurSong; Steps* pSteps = GAMESTATE->m_pCurNotes[p]; - // - // Add step totals. (In Summary evaluations, we've already done this.) - // - if( m_Type != summary ) - { - int iNumTapsAndHolds = (int) stageStats.fRadarPossible[p][RADAR_NUM_TAPS_AND_HOLDS]; - int iNumJumps = (int) stageStats.fRadarPossible[p][RADAR_NUM_JUMPS]; - int iNumHolds = (int) stageStats.fRadarPossible[p][RADAR_NUM_HOLDS]; - int iNumMines = (int) stageStats.fRadarPossible[p][RADAR_NUM_MINES]; - int iNumHands = (int) stageStats.fRadarPossible[p][RADAR_NUM_HANDS]; - - PROFILEMAN->AddStepTotals( p, iNumTapsAndHolds, iNumJumps, iNumHolds, iNumMines, iNumHands ); - } - // whether or not to save scores when the stage was failed // depends on if this is a course or not ... it's handled // below in the switch