fix more possible (lack of) Profile crashes.

not sure what to set val to in the case of no profile, though.
This commit is contained in:
Thad Ward
2004-02-09 21:05:20 +00:00
parent d5bd9327af
commit dffd82879e
+10 -5
View File
@@ -174,6 +174,7 @@ void PaneDisplay::SetContent( PaneContents c )
const Steps *pSteps = GAMESTATE->m_pCurNotes[m_PlayerNumber];
StepsType st = GAMESTATE->GetCurrentStyleDef()->m_StepsType;
const Course *pCourse = GAMESTATE->m_pCurCourse;
Profile *pProfile = PROFILEMAN->GetProfile(m_PlayerNumber);
float val = 0;
CString str;
@@ -195,16 +196,18 @@ void PaneDisplay::SetContent( PaneContents c )
case SONG_DIFFICULTY_RADAR_FREEZE: val = fRadarValues[RADAR_FREEZE]; break;
case SONG_DIFFICULTY_RADAR_CHAOS: val = fRadarValues[RADAR_CHAOS]; break;
case SONG_PROFILE_HIGH_SCORE:
val = 100.0f * PROFILEMAN->GetProfile(m_PlayerNumber)->GetStepsHighScoreList(pSteps).GetTopScore().fPercentDP;
if( pProfile )
val = 100.0f * pProfile->GetStepsHighScoreList(pSteps).GetTopScore().fPercentDP;
break;
case SONG_PROFILE_NUM_PLAYS:
val = (float) PROFILEMAN->GetProfile(m_PlayerNumber)->GetStepsNumTimesPlayed(pSteps);
if( pProfile )
val = (float) pProfile->GetStepsNumTimesPlayed(pSteps);
break;
case SONG_MACHINE_HIGH_NAME: /* set val for color */
case SONG_MACHINE_HIGH_SCORE:
CHECKPOINT;
val = 100.0f * PROFILEMAN->GetProfile(PROFILE_SLOT_MACHINE)->GetStepsHighScoreList(pSteps).GetTopScore().fPercentDP;
val = 100.0f * PROFILEMAN->GetMachineProfile()->GetStepsHighScoreList(pSteps).GetTopScore().fPercentDP;
break;
case SONG_MACHINE_RANK:
@@ -241,10 +244,12 @@ void PaneDisplay::SetContent( PaneContents c )
break;
case COURSE_PROFILE_HIGH_SCORE:
val = 100.0f * PROFILEMAN->GetProfile(m_PlayerNumber)->GetCourseHighScoreList(pCourse,st).GetTopScore().fPercentDP;
if( pProfile )
val = 100.0f * pProfile->GetCourseHighScoreList(pCourse,st).GetTopScore().fPercentDP;
break;
case COURSE_PROFILE_NUM_PLAYS:
val = (float) PROFILEMAN->GetProfile(m_PlayerNumber)->GetCourseNumTimesPlayed( pCourse );
if( pProfile )
val = (float) pProfile->GetCourseNumTimesPlayed( pCourse );
break;
case COURSE_PROFILE_RANK: