mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-12-13 11:32:35 +00:00
M_GetMenuCategoryFromFollower
Unified conversion for follower reference to menu category (as opposed to internal category). Fixes Jartha's flicky bug.
This commit is contained in:
parent
67aa3bb6e3
commit
15ef649e11
1 changed files with 32 additions and 26 deletions
|
|
@ -176,6 +176,29 @@ static void M_NewPlayerColors(setup_player_t *p)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static INT16 M_GetMenuCategoryFromFollower(setup_player_t *p)
|
||||||
|
{
|
||||||
|
if (p->followern < 0
|
||||||
|
|| p->followern >= numfollowers
|
||||||
|
|| !K_FollowerUsable(p->followern))
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
INT16 i;
|
||||||
|
|
||||||
|
for (i = 0; i < setup_numfollowercategories; i++)
|
||||||
|
{
|
||||||
|
if (followers[p->followern].category != setup_followercategories[i][1])
|
||||||
|
continue;
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (i >= setup_numfollowercategories)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
|
||||||
// sets up the grid pos for the skin used by the profile.
|
// sets up the grid pos for the skin used by the profile.
|
||||||
static void M_SetupProfileGridPos(setup_player_t *p)
|
static void M_SetupProfileGridPos(setup_player_t *p)
|
||||||
{
|
{
|
||||||
|
|
@ -189,10 +212,9 @@ static void M_SetupProfileGridPos(setup_player_t *p)
|
||||||
// While we're here, read follower values.
|
// While we're here, read follower values.
|
||||||
p->followern = K_FollowerAvailable(pr->follower);
|
p->followern = K_FollowerAvailable(pr->follower);
|
||||||
|
|
||||||
if (p->followern < 0 || p->followern >= numfollowers || followers[p->followern].category >= numfollowercategories || !K_FollowerUsable(p->followern))
|
p->followercategory = M_GetMenuCategoryFromFollower(p);
|
||||||
p->followercategory = p->followern = -1;
|
if (p->followercategory == -1) // unlock gate failed?
|
||||||
else
|
p->followern = -1;
|
||||||
p->followercategory = followers[p->followern].category;
|
|
||||||
|
|
||||||
p->followercolor = pr->followercolor;
|
p->followercolor = pr->followercolor;
|
||||||
if (K_ColorUsable(p->followercolor, true, true) == false)
|
if (K_ColorUsable(p->followercolor, true, true) == false)
|
||||||
|
|
@ -235,10 +257,9 @@ static void M_SetupMidGameGridPos(setup_player_t *p, UINT8 num)
|
||||||
p->followern = cv_follower[num].value;
|
p->followern = cv_follower[num].value;
|
||||||
p->followercolor = cv_followercolor[num].value;
|
p->followercolor = cv_followercolor[num].value;
|
||||||
|
|
||||||
if (p->followern < 0 || p->followern >= numfollowers || followers[p->followern].category >= numfollowercategories || !K_FollowerUsable(p->followern))
|
p->followercategory = M_GetMenuCategoryFromFollower(p);
|
||||||
p->followercategory = p->followern = -1;
|
if (p->followercategory == -1) // unlock gate failed?
|
||||||
else
|
p->followern = -1;
|
||||||
p->followercategory = followers[p->followern].category;
|
|
||||||
|
|
||||||
// Now position the grid for skin
|
// Now position the grid for skin
|
||||||
p->gridx = skins[i].kartspeed-1;
|
p->gridx = skins[i].kartspeed-1;
|
||||||
|
|
@ -1079,25 +1100,10 @@ static void M_HandleFollowerCategoryRotate(setup_player_t *p, UINT8 num)
|
||||||
}
|
}
|
||||||
else if (M_MenuExtraPressed(num))
|
else if (M_MenuExtraPressed(num))
|
||||||
{
|
{
|
||||||
INT16 i = -1;
|
p->followercategory = (p->followercategory == -1)
|
||||||
if (p->followercategory < 0
|
? M_GetMenuCategoryFromFollower(p)
|
||||||
&& p->followern >= 0
|
: -1;
|
||||||
&& p->followern < numfollowers
|
|
||||||
&& followers[p->followern].category < numfollowercategories)
|
|
||||||
{
|
|
||||||
for (i = 0; i < setup_numfollowercategories; i++)
|
|
||||||
{
|
|
||||||
if (followers[p->followern].category != setup_followercategories[i][1])
|
|
||||||
continue;
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (i >= setup_numfollowercategories)
|
|
||||||
i = -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
p->followercategory = i;
|
|
||||||
p->rotate = CSROTATETICS;
|
p->rotate = CSROTATETICS;
|
||||||
p->hitlag = true;
|
p->hitlag = true;
|
||||||
S_StartSound(NULL, sfx_s3k7b); //sfx_s3kc3s
|
S_StartSound(NULL, sfx_s3k7b); //sfx_s3kc3s
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue