simplify, fix crash

This commit is contained in:
Glenn Maynard
2003-11-10 19:05:04 +00:00
parent 7589a61591
commit bbbfd4a223
+4 -6
View File
@@ -231,15 +231,13 @@ void ScreenSelectMaster::UpdateSelectableChoices()
bool ScreenSelectMaster::Move( PlayerNumber pn, int dir )
{
int iSwitchToIndex = m_iChoice[pn];
while( iSwitchToIndex >= 0 && iSwitchToIndex < (int) m_aModeChoices.size() )
do
{
iSwitchToIndex += dir;
if( m_aModeChoices[iSwitchToIndex].IsPlayable() )
break;
if( iSwitchToIndex < 0 || iSwitchToIndex >= (int) m_aModeChoices.size() )
return false; // none found
}
while( iSwitchToIndex < 0 || iSwitchToIndex >= (int) m_aModeChoices.size() )
return false; // none found
while( !m_aModeChoices[iSwitchToIndex].IsPlayable() );
return ChangeSelection( pn, iSwitchToIndex );
}