- fixed: The class selection menu crashed when no item in the menu was selected.

SVN r2786 (trunk)
This commit is contained in:
Christoph Oelckers 2010-09-15 20:11:32 +00:00
parent d8fd72e19a
commit 5dfc57336e

View file

@ -424,14 +424,18 @@ void FListMenuItemPlayerDisplay::SetPlayerClass(int classnum, bool force)
bool FListMenuItemPlayerDisplay::UpdatePlayerClass() bool FListMenuItemPlayerDisplay::UpdatePlayerClass()
{ {
int classnum; if (mOwner->mSelectedItem >= 0)
FName seltype = mOwner->mItems[mOwner->mSelectedItem]->GetAction(&classnum); {
int classnum;
FName seltype = mOwner->mItems[mOwner->mSelectedItem]->GetAction(&classnum);
if (seltype != NAME_Episodemenu) return false; if (seltype != NAME_Episodemenu) return false;
if (PlayerClasses.Size() == 0) return false; if (PlayerClasses.Size() == 0) return false;
SetPlayerClass(classnum); SetPlayerClass(classnum);
return true; return true;
}
return false;
} }
//============================================================================= //=============================================================================