fix possible AVs
This commit is contained in:
@@ -74,11 +74,14 @@ void CourseContentsList::SetFromGameState()
|
|||||||
CourseEntryDisplay& display = m_CourseContentDisplays[m_iNumContents];
|
CourseEntryDisplay& display = m_CourseContentDisplays[m_iNumContents];
|
||||||
|
|
||||||
const TrailEntry* pte[NUM_PLAYERS];
|
const TrailEntry* pte[NUM_PLAYERS];
|
||||||
|
ZERO( pte );
|
||||||
|
|
||||||
FOREACH_EnabledPlayer(pn)
|
FOREACH_EnabledPlayer(pn)
|
||||||
{
|
{
|
||||||
Trail* pTrail = GAMESTATE->m_pCurTrail[pn];
|
Trail* pTrail = GAMESTATE->m_pCurTrail[pn];
|
||||||
if( pTrail == NULL )
|
if( pTrail == NULL )
|
||||||
continue;
|
continue; // skip
|
||||||
|
if( i < pTrail->m_vEntries.size() )
|
||||||
pte[pn] = &pTrail->m_vEntries[i];
|
pte[pn] = &pTrail->m_vEntries[i];
|
||||||
}
|
}
|
||||||
display.LoadFromTrailEntry( m_iNumContents+1, pte );
|
display.LoadFromTrailEntry( m_iNumContents+1, pte );
|
||||||
|
|||||||
@@ -90,6 +90,8 @@ void CourseEntryDisplay::SetDifficulty( PlayerNumber pn, const CString &text, Ra
|
|||||||
void CourseEntryDisplay::LoadFromTrailEntry( int iNum, const TrailEntry *tes[NUM_PLAYERS] )
|
void CourseEntryDisplay::LoadFromTrailEntry( int iNum, const TrailEntry *tes[NUM_PLAYERS] )
|
||||||
{
|
{
|
||||||
const TrailEntry *te = tes[GAMESTATE->m_MasterPlayerNumber];
|
const TrailEntry *te = tes[GAMESTATE->m_MasterPlayerNumber];
|
||||||
|
if( te == NULL )
|
||||||
|
return;
|
||||||
bool bMystery = te->bMystery;
|
bool bMystery = te->bMystery;
|
||||||
if( bMystery )
|
if( bMystery )
|
||||||
{
|
{
|
||||||
@@ -115,6 +117,8 @@ void CourseEntryDisplay::LoadFromTrailEntry( int iNum, const TrailEntry *tes[NUM
|
|||||||
FOREACH_EnabledPlayer(pn)
|
FOREACH_EnabledPlayer(pn)
|
||||||
{
|
{
|
||||||
const TrailEntry *te = tes[pn];
|
const TrailEntry *te = tes[pn];
|
||||||
|
if( te == NULL )
|
||||||
|
continue;
|
||||||
RageColor colorNotes = SONGMAN->GetDifficultyColor( te->pSteps->GetDifficulty() );
|
RageColor colorNotes = SONGMAN->GetDifficultyColor( te->pSteps->GetDifficulty() );
|
||||||
SetDifficulty( pn, ssprintf("%d", te->pSteps->GetMeter()), colorNotes );
|
SetDifficulty( pn, ssprintf("%d", te->pSteps->GetMeter()), colorNotes );
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user