From f633a309d7c96f3ef9c53a45f21c978137d03628 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Wed, 8 Sep 2004 00:03:06 +0000 Subject: [PATCH] cleanup fix crash --- stepmania/src/CourseEntryDisplay.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/stepmania/src/CourseEntryDisplay.cpp b/stepmania/src/CourseEntryDisplay.cpp index 9c39503044..565e7331c3 100644 --- a/stepmania/src/CourseEntryDisplay.cpp +++ b/stepmania/src/CourseEntryDisplay.cpp @@ -78,19 +78,22 @@ void CourseEntryDisplay::LoadFromTrailEntry( int iNum, const TrailEntry *tes[NUM const TrailEntry *te = tes[GAMESTATE->m_MasterPlayerNumber]; if( te == NULL ) return; - bool bMystery = te->bMystery; - if( bMystery ) + + if( te->bMystery ) { FOREACH_EnabledPlayer(pn) { const TrailEntry *te = tes[pn]; + if( te == NULL ) + continue; + Difficulty dc = te->dc; if( dc == DIFFICULTY_INVALID ) { int iLow = te->iLowMeter; int iHigh = te->iHighMeter; - SetDifficulty( pn, ssprintf(iLow==iHigh?"%d":"%d-%d", iLow, iHigh), - SONGMAN->GetDifficultyColor(te->pSteps->GetDifficulty()) ); + RageColor colorNotes = SONGMAN->GetDifficultyColor( te->pSteps->GetDifficulty() ); + SetDifficulty( pn, ssprintf(iLow==iHigh?"%d":"%d-%d", iLow, iHigh), colorNotes ); } else SetDifficulty( pn, "?", SONGMAN->GetDifficultyColor( dc ) );