fix 5th scoring eval crash
cleanup
This commit is contained in:
@@ -212,11 +212,14 @@ void ScreenEvaluation::Init()
|
||||
|
||||
if( PREFSMAN->m_iScoringType == PrefsManager::SCORING_5TH )
|
||||
{
|
||||
int ScoreBonuses[9] = {0, 0, 100, 1000, 10000, 100000, 1000000, 10000000, 10000000};
|
||||
const int ScoreBonuses[] = { 10000000, 10000000, 1000000, 100000, 10000, 1000, 100 };
|
||||
if( grade[p] < ARRAYSIZE(ScoreBonuses) )
|
||||
{
|
||||
g_CurStageStats.iBonus[p] += ScoreBonuses[(int)grade[p] ];
|
||||
stageStats.iBonus[p] += ScoreBonuses[(int)grade[p] ];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
@@ -1230,6 +1233,9 @@ void ScreenEvaluation::Update( float fDeltaTime )
|
||||
|
||||
for( int p=0; p<NUM_PLAYERS; p++)
|
||||
{
|
||||
if( !GAMESTATE->IsPlayerEnabled(p) )
|
||||
continue;
|
||||
|
||||
if( g_CurStageStats.iBonus[p] == 0 )
|
||||
continue;
|
||||
|
||||
@@ -1241,6 +1247,7 @@ void ScreenEvaluation::Update( float fDeltaTime )
|
||||
continue;
|
||||
|
||||
int increment = g_CurStageStats.iBonus[p]/10;
|
||||
/* XXX: What's this supposed to do? If i < 1, then min(i, 1024) is i ... */
|
||||
if( increment < 1 )
|
||||
increment = min( 1024, g_CurStageStats.iBonus[p] );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user