CharSel: Make sure the clone we're hovering over actually exists

This commit is contained in:
SinnamonLat 2022-02-19 22:15:56 +01:00
parent 2789d1d90e
commit 7612d7cdf9

View file

@ -2296,6 +2296,8 @@ static boolean M_HandleCharacterGrid(setup_player_t *p, UINT8 num)
{
INT32 i;
UINT8 numclones;
if (menucmd[num].dpad_ud > 0)
{
p->gridy++;
@ -2330,6 +2332,13 @@ static boolean M_HandleCharacterGrid(setup_player_t *p, UINT8 num)
M_SetMenuDelay(num);
}
// Process this after possible pad movement,
// this makes sure we don't have a weird ghost hover on a character with no clones.
numclones = setup_chargrid[p->gridx][p->gridy].numskins;
if (p->clonenum >= numclones)
p->clonenum = 0;
if (M_MenuButtonPressed(num, MBT_A) || M_MenuButtonPressed(num, MBT_X) /*|| M_MenuButtonPressed(num, MBT_START)*/)
{
if (setup_chargrid[p->gridx][p->gridy].numskins == 0)