fixed long/marathon scoring/ranking issues (bug 730086)
This commit is contained in:
@@ -453,10 +453,22 @@ void GameState::GetFinalEvalStatsAndSongs( StageStats& statsOut, vector<Song*>&
|
|||||||
statsOut = StageStats();
|
statsOut = StageStats();
|
||||||
|
|
||||||
// Show stats only for the latest 3 normal songs + passed extra stages
|
// Show stats only for the latest 3 normal songs + passed extra stages
|
||||||
int iNumSongsToThrowAway = max( 0, PREFSMAN->m_iNumArcadeStages-3 );
|
int iNumPassedExtraStages = GAMESTATE->IsExtraStage ? 1 : (GAMESTATE->IsExtraStage2 ? 2 : 0);
|
||||||
for( unsigned i=iNumSongsToThrowAway; i<GAMESTATE->m_vPassedStageStats.size(); i++ )
|
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];
|
statsOut += GAMESTATE->m_vPassedStageStats[i];
|
||||||
|
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||||
|
if( IsPlayerEnabled(p) )
|
||||||
|
statsOut.iMeter[p] += GAMESTATE->m_vPassedStageStats[i].iMeter[p] * (iLengthMultiplier-1);
|
||||||
|
|
||||||
vSongsOut.push_back( GAMESTATE->m_vPassedStageStats[i].pSong );
|
vSongsOut.push_back( GAMESTATE->m_vPassedStageStats[i].pSong );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
#include "Course.h"
|
#include "Course.h"
|
||||||
#include "UnlockSystem.h"
|
#include "UnlockSystem.h"
|
||||||
#include "SDL_utils.h"
|
#include "SDL_utils.h"
|
||||||
|
#include "SongManager.h"
|
||||||
|
|
||||||
|
|
||||||
ScoreKeeperMAX2::ScoreKeeperMAX2( const vector<Notes*>& apNotes_, PlayerNumber pn_ ):
|
ScoreKeeperMAX2::ScoreKeeperMAX2( const vector<Notes*>& apNotes_, PlayerNumber pn_ ):
|
||||||
@@ -123,8 +124,11 @@ void ScoreKeeperMAX2::OnNextSong( int iSongInCourseIndex, Notes* pNotes, NoteDat
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const int iMeter = clamp(pNotes->GetMeter(), 1, 10);
|
const int iMeter = clamp( pNotes->GetMeter(), 1, 10 );
|
||||||
m_iMaxPossiblePoints = iMeter * 10000000;
|
|
||||||
|
// 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 );
|
ASSERT( m_iMaxPossiblePoints >= 0 );
|
||||||
m_iMaxScoreSoFar += m_iMaxPossiblePoints;
|
m_iMaxScoreSoFar += m_iMaxPossiblePoints;
|
||||||
|
|||||||
Reference in New Issue
Block a user