- Fixed: Episodes with NoSkillMenu defined had their own idea of default skill that differed

from episodes with skill menus (and completely ignored whichever skill is explicitly defined
  as the default skill).

SVN r3346 (trunk)
This commit is contained in:
Randy Heit 2012-01-24 03:16:24 +00:00
parent ef88515dda
commit 9d67dc36e8
2 changed files with 20 additions and 8 deletions

View file

@ -671,6 +671,7 @@ void M_ActivateMenu(DMenu *menu);
void M_ClearMenus ();
void M_ParseMenuDefs();
void M_StartupSkillMenu(FGameStartup *gs);
int M_GetDefaultSkill();
void M_StartControlPanel (bool makeSound);
void M_SetMenu(FName menu, int param = -1);
void M_NotifyNewSave (const char *file, const char *title, bool okForQuicksave);

View file

@ -1235,7 +1235,7 @@ void M_CreateMenus()
//=============================================================================
//
// THe skill menu must be refeshed each time it starts up
// The skill menu must be refeshed each time it starts up
//
//=============================================================================
extern int restart;
@ -1345,7 +1345,7 @@ void M_StartupSkillMenu(FGameStartup *gs)
}
if (AllEpisodes[gs->Episode].mNoSkill || AllSkills.Size() == 1)
{
ld->mAutoselect = firstitem + MIN(2u, AllSkills.Size()-1);
ld->mAutoselect = firstitem + M_GetDefaultSkill();
}
else
{
@ -1400,12 +1400,23 @@ fail:
if (!done)
{
done = true;
int defskill = DefaultSkill;
if ((unsigned int)defskill >= AllSkills.Size())
{
defskill = (AllSkills.Size() - 1) / 2;
}
od->mSelectedItem = defskill;
od->mSelectedItem = M_GetDefaultSkill();
}
}
}
//=============================================================================
//
// Returns the default skill level.
//
//=============================================================================
int M_GetDefaultSkill()
{
int defskill = DefaultSkill;
if ((unsigned int)defskill >= AllSkills.Size())
{
defskill = (AllSkills.Size() - 1) / 2;
}
return defskill;
}