fix pushing players off of unselectable choices
This commit is contained in:
@@ -417,14 +417,20 @@ void ScreenSelectDifficulty::MenuStart( PlayerNumber pn )
|
|||||||
int iSwitchToIndex = -1;
|
int iSwitchToIndex = -1;
|
||||||
int i;
|
int i;
|
||||||
for( i=m_iChoiceOnPage[p]+1; iSwitchToIndex == -1 && i < (int) m_ModeChoices[m_CurrentPage].size(); ++i )
|
for( i=m_iChoiceOnPage[p]+1; iSwitchToIndex == -1 && i < (int) m_ModeChoices[m_CurrentPage].size(); ++i )
|
||||||
if( m_ModeChoices[m_CurrentPage][i].IsPlayable() )
|
{
|
||||||
|
const ModeChoice &mc = m_ModeChoices[m_CurrentPage][i];
|
||||||
|
if( mc.IsPlayable() && !BothPlayersModeChoice(mc) )
|
||||||
iSwitchToIndex = i;
|
iSwitchToIndex = i;
|
||||||
|
}
|
||||||
if( iSwitchToIndex == -1 ) /* couldn't find a spot looking up; look down */
|
if( iSwitchToIndex == -1 ) /* couldn't find a spot looking up; look down */
|
||||||
{
|
{
|
||||||
for( i=m_iChoiceOnPage[p]-1; iSwitchToIndex == -1 && i >= 0; --i )
|
for( i=m_iChoiceOnPage[p]-1; iSwitchToIndex == -1 && i >= 0; --i )
|
||||||
if( m_ModeChoices[m_CurrentPage][i].IsPlayable() )
|
{
|
||||||
|
const ModeChoice &mc = m_ModeChoices[m_CurrentPage][i];
|
||||||
|
if( mc.IsPlayable() && !BothPlayersModeChoice(mc) )
|
||||||
iSwitchToIndex = i;
|
iSwitchToIndex = i;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/* We should always find a place to go--we should at least be able to choose
|
/* We should always find a place to go--we should at least be able to choose
|
||||||
* the same thing pn picked. */
|
* the same thing pn picked. */
|
||||||
ASSERT( iSwitchToIndex != -1 );
|
ASSERT( iSwitchToIndex != -1 );
|
||||||
|
|||||||
Reference in New Issue
Block a user