From 579c9756387e9c70bcbde2f831025984069126d9 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Sat, 2 Aug 2003 21:47:04 +0000 Subject: [PATCH] fixed long/marathon scoring/ranking issues (bug 730086) --- stepmania/src/GameState.cpp | 16 ++++++++++++++-- stepmania/src/ScoreKeeperMAX2.cpp | 8 ++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/stepmania/src/GameState.cpp b/stepmania/src/GameState.cpp index c5e96a9874..c5bdb2d5f8 100644 --- a/stepmania/src/GameState.cpp +++ b/stepmania/src/GameState.cpp @@ -453,10 +453,22 @@ void GameState::GetFinalEvalStatsAndSongs( StageStats& statsOut, vector& statsOut = StageStats(); // Show stats only for the latest 3 normal songs + passed extra stages - int iNumSongsToThrowAway = max( 0, PREFSMAN->m_iNumArcadeStages-3 ); - for( unsigned i=iNumSongsToThrowAway; im_vPassedStageStats.size(); i++ ) + int iNumPassedExtraStages = GAMESTATE->IsExtraStage ? 1 : (GAMESTATE->IsExtraStage2 ? 2 : 0); + int iNumPassedRegularSongs = GAMESTATE->m_vPassedStageStats.size() - iNumPassedExtraStages; + int iNumSongsToShow = iNumPassedExtraStages + min( iNumPassedRegularSongs, 3 ); + int iNumSongsToThrowAway = GAMESTATE->m_vPassedStageStats.size() - iNumSongsToShow; + ASSERT( iNumSongsToThrowAway >= 0 ); + + for( int i=iNumSongsToThrowAway; i<(int)GAMESTATE->m_vPassedStageStats.size(); i++ ) { + // weight long and marathon songs + int iLengthMultiplier = SongManager::GetNumStagesForSong( GAMESTATE->m_vPassedStageStats[i].pSong ); + statsOut += GAMESTATE->m_vPassedStageStats[i]; + for( int p=0; pm_vPassedStageStats[i].iMeter[p] * (iLengthMultiplier-1); + vSongsOut.push_back( GAMESTATE->m_vPassedStageStats[i].pSong ); } diff --git a/stepmania/src/ScoreKeeperMAX2.cpp b/stepmania/src/ScoreKeeperMAX2.cpp index d1ce5a133d..9875beb47b 100644 --- a/stepmania/src/ScoreKeeperMAX2.cpp +++ b/stepmania/src/ScoreKeeperMAX2.cpp @@ -20,6 +20,7 @@ #include "Course.h" #include "UnlockSystem.h" #include "SDL_utils.h" +#include "SongManager.h" ScoreKeeperMAX2::ScoreKeeperMAX2( const vector& apNotes_, PlayerNumber pn_ ): @@ -123,8 +124,11 @@ void ScoreKeeperMAX2::OnNextSong( int iSongInCourseIndex, Notes* pNotes, NoteDat } else { - const int iMeter = clamp(pNotes->GetMeter(), 1, 10); - m_iMaxPossiblePoints = iMeter * 10000000; + const int iMeter = clamp( pNotes->GetMeter(), 1, 10 ); + + // long ver and marathon ver songs have higher max possible scores + int iLengthMultiplier = SongManager::GetNumStagesForSong( GAMESTATE->m_pCurSong ); + m_iMaxPossiblePoints = iMeter * 10000000 * iLengthMultiplier; } ASSERT( m_iMaxPossiblePoints >= 0 ); m_iMaxScoreSoFar += m_iMaxPossiblePoints;