mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Don't use skincolor unlocks in situations where gamedata is inappropriate
- Recieving a different client's XD_NAMEANDCOLOR - Loading profiles on game boot
This commit is contained in:
parent
c20a76586c
commit
a07a9e2191
6 changed files with 17 additions and 16 deletions
|
|
@ -917,7 +917,7 @@ static void COM_Help_f(void)
|
||||||
boolean follower = (cvar->PossibleValue == Followercolor_cons_t);
|
boolean follower = (cvar->PossibleValue == Followercolor_cons_t);
|
||||||
for (i = SKINCOLOR_NONE; i < numskincolors; ++i)
|
for (i = SKINCOLOR_NONE; i < numskincolors; ++i)
|
||||||
{
|
{
|
||||||
if (K_ColorUsable(i, follower) == true)
|
if (K_ColorUsable(i, follower, true) == true)
|
||||||
{
|
{
|
||||||
CONS_Printf(" %-3d : %s\n", i, skincolors[i].name);
|
CONS_Printf(" %-3d : %s\n", i, skincolors[i].name);
|
||||||
if (i == cvar->value)
|
if (i == cvar->value)
|
||||||
|
|
|
||||||
|
|
@ -1497,9 +1497,9 @@ static void SendNameAndColor(const UINT8 n)
|
||||||
UINT16 sendFollowerColor = cv_followercolor[n].value;
|
UINT16 sendFollowerColor = cv_followercolor[n].value;
|
||||||
|
|
||||||
// don't allow inaccessible colors
|
// don't allow inaccessible colors
|
||||||
if (sendColor != SKINCOLOR_NONE && K_ColorUsable(sendColor, false) == false)
|
if (sendColor != SKINCOLOR_NONE && K_ColorUsable(sendColor, false, true) == false)
|
||||||
{
|
{
|
||||||
if (player->skincolor && K_ColorUsable(player->skincolor, false) == true)
|
if (player->skincolor && K_ColorUsable(player->skincolor, false, true) == true)
|
||||||
{
|
{
|
||||||
// Use our previous color
|
// Use our previous color
|
||||||
CV_StealthSetValue(&cv_playercolor[n], player->skincolor);
|
CV_StealthSetValue(&cv_playercolor[n], player->skincolor);
|
||||||
|
|
@ -1514,7 +1514,7 @@ static void SendNameAndColor(const UINT8 n)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ditto for follower colour:
|
// ditto for follower colour:
|
||||||
if (sendFollowerColor != SKINCOLOR_NONE && K_ColorUsable(sendFollowerColor, true) == false)
|
if (sendFollowerColor != SKINCOLOR_NONE && K_ColorUsable(sendFollowerColor, true, true) == false)
|
||||||
{
|
{
|
||||||
CV_StealthSet(&cv_followercolor[n], "Default"); // set it to "Default". I don't care about your stupidity!
|
CV_StealthSet(&cv_followercolor[n], "Default"); // set it to "Default". I don't care about your stupidity!
|
||||||
sendFollowerColor = cv_followercolor[n].value;
|
sendFollowerColor = cv_followercolor[n].value;
|
||||||
|
|
@ -1724,7 +1724,7 @@ static void Got_NameAndColor(UINT8 **cp, INT32 playernum)
|
||||||
boolean kick = false;
|
boolean kick = false;
|
||||||
|
|
||||||
// don't allow inaccessible colors
|
// don't allow inaccessible colors
|
||||||
if (K_ColorUsable(p->skincolor, false) == false)
|
if (K_ColorUsable(p->skincolor, false, false) == false)
|
||||||
{
|
{
|
||||||
kick = true;
|
kick = true;
|
||||||
}
|
}
|
||||||
|
|
@ -6829,7 +6829,7 @@ static void Color_OnChange(const UINT8 p)
|
||||||
I_Assert(p < MAXSPLITSCREENPLAYERS);
|
I_Assert(p < MAXSPLITSCREENPLAYERS);
|
||||||
|
|
||||||
UINT16 color = cv_playercolor[p].value;
|
UINT16 color = cv_playercolor[p].value;
|
||||||
boolean colorisgood = (color == SKINCOLOR_NONE || K_ColorUsable(color, false) == true);
|
boolean colorisgood = (color == SKINCOLOR_NONE || K_ColorUsable(color, false, true) == true);
|
||||||
|
|
||||||
if (Playing() && splitscreen < p)
|
if (Playing() && splitscreen < p)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -217,11 +217,11 @@ void K_GenerateKartColormap(UINT8 *dest_colormap, INT32 skinnum, UINT8 color)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*--------------------------------------------------
|
/*--------------------------------------------------
|
||||||
boolean K_ColorUsable(skincolornum_t color, boolean follower)
|
boolean K_ColorUsable(skincolornum_t color, boolean follower, boolean locked)
|
||||||
|
|
||||||
See header file for description.
|
See header file for description.
|
||||||
--------------------------------------------------*/
|
--------------------------------------------------*/
|
||||||
boolean K_ColorUsable(skincolornum_t color, boolean follower)
|
boolean K_ColorUsable(skincolornum_t color, boolean follower, boolean locked)
|
||||||
{
|
{
|
||||||
INT32 i = MAXUNLOCKABLES;
|
INT32 i = MAXUNLOCKABLES;
|
||||||
|
|
||||||
|
|
@ -237,7 +237,7 @@ boolean K_ColorUsable(skincolornum_t color, boolean follower)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (demo.playback)
|
if (demo.playback || !locked)
|
||||||
{
|
{
|
||||||
// Simplifies things elsewhere...
|
// Simplifies things elsewhere...
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -117,7 +117,7 @@ void K_GenerateKartColormap(UINT8 *dest_colormap, INT32 skinnum, UINT8 color);
|
||||||
|
|
||||||
|
|
||||||
/*--------------------------------------------------
|
/*--------------------------------------------------
|
||||||
boolean K_ColorUsable(skincolornum_t color, skin_t *skin, follower_t *follower);
|
boolean K_ColorUsable(skincolornum_t color, skin_t *skin, follower_t *follower, boolean locked);
|
||||||
|
|
||||||
Determines whenever or not we meet the unlockable conditions
|
Determines whenever or not we meet the unlockable conditions
|
||||||
to use a certain color.
|
to use a certain color.
|
||||||
|
|
@ -125,12 +125,13 @@ void K_GenerateKartColormap(UINT8 *dest_colormap, INT32 skinnum, UINT8 color);
|
||||||
Input Arguments:-
|
Input Arguments:-
|
||||||
color - Color we want to use.
|
color - Color we want to use.
|
||||||
follower - Set to include the special follower-only color options.
|
follower - Set to include the special follower-only color options.
|
||||||
|
locked - use local player's unlocks.
|
||||||
|
|
||||||
Return:-
|
Return:-
|
||||||
true if we can use it, otherwise false.
|
true if we can use it, otherwise false.
|
||||||
--------------------------------------------------*/
|
--------------------------------------------------*/
|
||||||
|
|
||||||
boolean K_ColorUsable(skincolornum_t color, boolean follower);
|
boolean K_ColorUsable(skincolornum_t color, boolean follower, boolean locked);
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
||||||
|
|
@ -373,7 +373,7 @@ void PR_LoadProfiles(void)
|
||||||
; // Valid, even outside the bounds
|
; // Valid, even outside the bounds
|
||||||
}
|
}
|
||||||
else if (profilesList[i]->color >= numskincolors
|
else if (profilesList[i]->color >= numskincolors
|
||||||
|| K_ColorUsable(profilesList[i]->color, false) == false)
|
|| K_ColorUsable(profilesList[i]->color, false, false) == false)
|
||||||
{
|
{
|
||||||
profilesList[i]->color = PROFILEDEFAULTCOLOR;
|
profilesList[i]->color = PROFILEDEFAULTCOLOR;
|
||||||
}
|
}
|
||||||
|
|
@ -383,13 +383,13 @@ void PR_LoadProfiles(void)
|
||||||
profilesList[i]->followercolor = READUINT16(save.p);
|
profilesList[i]->followercolor = READUINT16(save.p);
|
||||||
|
|
||||||
if (profilesList[i]->followercolor == FOLLOWERCOLOR_MATCH
|
if (profilesList[i]->followercolor == FOLLOWERCOLOR_MATCH
|
||||||
|| profilesList[i]->followercolor == FOLLOWERCOLOR_OPPOSITE)
|
|| profilesList[i]->followercolor == FOLLOWERCOLOR_OPPOSITE
|
||||||
|
|| profilesList[i]->followercolor == SKINCOLOR_NONE)
|
||||||
{
|
{
|
||||||
; // Valid, even outside the bounds
|
; // Valid, even outside the bounds
|
||||||
}
|
}
|
||||||
else if (profilesList[i]->followercolor >= numskincolors
|
else if (profilesList[i]->followercolor >= numskincolors
|
||||||
|| profilesList[i]->followercolor == SKINCOLOR_NONE
|
|| K_ColorUsable(profilesList[i]->followercolor, true, false) == false)
|
||||||
|| K_ColorUsable(profilesList[i]->followercolor, true) == false)
|
|
||||||
{
|
{
|
||||||
profilesList[i]->followercolor = PROFILEDEFAULTFOLLOWERCOLOR;
|
profilesList[i]->followercolor = PROFILEDEFAULTFOLLOWERCOLOR;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -150,7 +150,7 @@ static void M_NewPlayerColors(setup_player_t *p)
|
||||||
// Add all unlocked colors
|
// Add all unlocked colors
|
||||||
for (i = SKINCOLOR_NONE+1; i < numskincolors; i++)
|
for (i = SKINCOLOR_NONE+1; i < numskincolors; i++)
|
||||||
{
|
{
|
||||||
if (K_ColorUsable(i, follower) == true)
|
if (K_ColorUsable(i, follower, true) == true)
|
||||||
{
|
{
|
||||||
M_PushMenuColor(&p->colors, i);
|
M_PushMenuColor(&p->colors, i);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue