mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-24 21:21:04 +00:00
- 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:
parent
ef88515dda
commit
9d67dc36e8
2 changed files with 20 additions and 8 deletions
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue