fixed a crash that would occur when hugging the bottem edge of a menu with one option example: auto=choice sacrifice
This commit is contained in:
@@ -247,7 +247,14 @@ bool SimpleMenu::CheckUserInput(JButton key)
|
||||
if (y < menuTopEdge)
|
||||
n = (mCurr - 1) > 0 ? mCurr -1 : 0;
|
||||
else if (y >= menuBottomEdge)
|
||||
n = (mCurr + 1) < mCount ? mCurr + 1 : mCurr - 1;
|
||||
{
|
||||
if(mCurr +1 < mCount)
|
||||
n = mCurr + 1;
|
||||
else if(mCurr - 1 > 0)
|
||||
n = mCurr - 1;
|
||||
else
|
||||
n = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < mCount; i++)
|
||||
@@ -259,7 +266,6 @@ bool SimpleMenu::CheckUserInput(JButton key)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// check to see if the user clicked
|
||||
if (n != mCurr && mObjects[mCurr] != NULL && mObjects[mCurr]->Leaving(JGE_BTN_DOWN))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user