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:
Devin J. Pohly
2014-02-08 21:39:26 -05:00
parent 911a0d6471
commit 57a142b76f
+7 -2
View File
@@ -390,12 +390,17 @@ static void CoinModeNoHome( int &sel, bool ToSel, const ConfOption *pConfOption
if( ToSel )
{
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
{
int tmp = sel + 1;
MovePref<CoinMode>( sel, ToSel, pConfOption );
MovePref<CoinMode>( tmp, ToSel, pConfOption );
}
}