simplify, fix crash
This commit is contained in:
@@ -231,15 +231,13 @@ void ScreenSelectMaster::UpdateSelectableChoices()
|
|||||||
bool ScreenSelectMaster::Move( PlayerNumber pn, int dir )
|
bool ScreenSelectMaster::Move( PlayerNumber pn, int dir )
|
||||||
{
|
{
|
||||||
int iSwitchToIndex = m_iChoice[pn];
|
int iSwitchToIndex = m_iChoice[pn];
|
||||||
while( iSwitchToIndex >= 0 && iSwitchToIndex < (int) m_aModeChoices.size() )
|
do
|
||||||
{
|
{
|
||||||
iSwitchToIndex += dir;
|
iSwitchToIndex += dir;
|
||||||
if( m_aModeChoices[iSwitchToIndex].IsPlayable() )
|
if( iSwitchToIndex < 0 || iSwitchToIndex >= (int) m_aModeChoices.size() )
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
while( iSwitchToIndex < 0 || iSwitchToIndex >= (int) m_aModeChoices.size() )
|
|
||||||
return false; // none found
|
return false; // none found
|
||||||
|
}
|
||||||
|
while( !m_aModeChoices[iSwitchToIndex].IsPlayable() );
|
||||||
|
|
||||||
return ChangeSelection( pn, iSwitchToIndex );
|
return ChangeSelection( pn, iSwitchToIndex );
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user