- fixed: DOptionMenu::FirstSelectable should not be called when the menu already has a valid selection.

SVN r2863 (trunk)
This commit is contained in:
Christoph Oelckers 2010-09-29 00:54:14 +00:00
parent e2c105b447
commit 64784b2dc8

View file

@ -96,7 +96,7 @@ void DOptionMenu::Init(DMenu *parent, FOptionMenuDescriptor *desc)
mParentMenu = parent; mParentMenu = parent;
GC::WriteBarrier(this, parent); GC::WriteBarrier(this, parent);
mDesc = desc; mDesc = desc;
if (mDesc != NULL) mDesc->mSelectedItem = FirstSelectable(); if (mDesc != NULL && mDesc->mSelectedItem == -1) mDesc->mSelectedItem = FirstSelectable();
} }
@ -108,7 +108,7 @@ void DOptionMenu::Init(DMenu *parent, FOptionMenuDescriptor *desc)
int DOptionMenu::FirstSelectable() int DOptionMenu::FirstSelectable()
{ {
if (mDesc != NULL && mDesc->mSelectedItem < 0) if (mDesc != NULL)
{ {
// Go down to the first selectable item // Go down to the first selectable item
int i = -1; int i = -1;