[ScreenSelectMaster] Fix a crash ("the" crash, really) concerning cursors. Turns out cursors AREN'T always made for players. Only set to invisible if the cursor exists.

This commit is contained in:
AJ Kelly
2010-05-13 23:02:39 -05:00
parent ec06d16403
commit 199ed3d130
+6 -6
View File
@@ -261,7 +261,7 @@ void ScreenSelectMaster::Init()
}
m_mapCurrentChoiceToNextChoiceB[dir][c] = c + add;
/* Always wrap around MenuDir_Auto. */
// Always wrap around MenuDir_Auto.
if( dir == MenuDir_Auto || (bool)WRAP_CURSOR )
wrap( m_mapCurrentChoiceToNextChoiceB[dir][c], m_aGameCommandsB.size() );
else
@@ -391,11 +391,11 @@ void ScreenSelectMaster::BeginScreen()
{
if( GAMESTATE->IsHumanPlayer(pn) )
continue;
/*
XXX: this code causes crashes
if( SHOW_CURSOR )
m_sprCursor[pn]->SetVisible( false );
*/
{
if(m_sprCursor[pn])
m_sprCursor[pn]->SetVisible( false );
}
if( SHOW_SCROLLER )
m_Scroller[pn].SetVisible( false );
}
@@ -765,7 +765,7 @@ bool ScreenSelectMaster::ChangePage( int iNewChoice )
m_sprCursor[*p]->HandleMessage( msg );
m_sprCursor[*p]->SetXY( GetCursorX(*p), GetCursorY(*p) );
}
if( SHOW_SCROLLER )
m_vsprScroll[*p][m_iChoice[*p]]->HandleMessage( msg );
}