fix logic/crash in CoinModeNoHome option
This option was returning -1 for an index and triggering an assert, and the logic in the other direction was typoed.
This commit is contained in:
@@ -390,12 +390,17 @@ static void CoinModeNoHome( int &sel, bool ToSel, const ConfOption *pConfOption
|
|||||||
if( ToSel )
|
if( ToSel )
|
||||||
{
|
{
|
||||||
MovePref<CoinMode>( sel, ToSel, pConfOption );
|
MovePref<CoinMode>( sel, ToSel, pConfOption );
|
||||||
sel--;
|
// If the mode was Pay, the index is 0; otherwise, set the index
|
||||||
|
// to 1 to avoid out-of-range crashing.
|
||||||
|
if (sel == 1)
|
||||||
|
sel = 0;
|
||||||
|
else
|
||||||
|
sel = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int tmp = sel + 1;
|
int tmp = sel + 1;
|
||||||
MovePref<CoinMode>( sel, ToSel, pConfOption );
|
MovePref<CoinMode>( tmp, ToSel, pConfOption );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user