mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-02-15 10:06:24 +00:00
Fix SECRET_SKIN locks preventing Rivals from showing up
Previously, there was a permanent exception for Eggrobo (the default bot skin). Now that exception is generalised for the specific skin the bot is being assigned, which we assume is intentful and correct. In addition, the randomclass PR_BOTS now controls K_RetireBots as well, matching the other two random calls done for bot skins.
This commit is contained in:
parent
b937b1a7bc
commit
8bb41b787b
6 changed files with 12 additions and 10 deletions
|
|
@ -917,7 +917,7 @@ static boolean CL_SendJoin(void)
|
|||
for (; i < MAXSPLITSCREENPLAYERS; i++)
|
||||
strncpy(netbuffer->u.clientcfg.names[i], va("Player %c", 'A' + i), MAXPLAYERNAME);
|
||||
|
||||
memcpy(&netbuffer->u.clientcfg.availabilities, R_GetSkinAvailabilities(false, false), MAXAVAILABILITY*sizeof(UINT8));
|
||||
memcpy(&netbuffer->u.clientcfg.availabilities, R_GetSkinAvailabilities(false, -1), MAXAVAILABILITY*sizeof(UINT8));
|
||||
|
||||
// Don't leak old signatures from prior sessions.
|
||||
memset(&netbuffer->u.clientcfg.challengeResponse, 0, sizeof(((clientconfig_pak *)0)->challengeResponse));
|
||||
|
|
@ -4332,7 +4332,7 @@ boolean SV_SpawnServer(void)
|
|||
// strictly speaking, i'm not convinced the following is necessary
|
||||
// but I'm not confident enough to remove it entirely in case it breaks something
|
||||
{
|
||||
UINT8 *availabilitiesbuffer = R_GetSkinAvailabilities(false, false);
|
||||
UINT8 *availabilitiesbuffer = R_GetSkinAvailabilities(false, -1);
|
||||
SINT8 node = 0;
|
||||
for (; node < MAXNETNODES; node++)
|
||||
result |= SV_AddWaitingPlayers(node, availabilitiesbuffer,
|
||||
|
|
|
|||
|
|
@ -2236,7 +2236,7 @@ static void G_SaveDemoSkins(UINT8 **pp)
|
|||
{
|
||||
char skin[16];
|
||||
UINT8 i;
|
||||
UINT8 *availabilitiesbuffer = R_GetSkinAvailabilities(true, false);
|
||||
UINT8 *availabilitiesbuffer = R_GetSkinAvailabilities(true, -1);
|
||||
|
||||
WRITEUINT8((*pp), numskins);
|
||||
for (i = 0; i < numskins; i++)
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ void K_SetBot(UINT8 newplayernum, UINT8 skinnum, UINT8 difficulty, botStyle_e st
|
|||
playernode[newplayernum] = servernode;
|
||||
|
||||
// this will permit unlocks
|
||||
memcpy(&players[newplayernum].availabilities, R_GetSkinAvailabilities(false, true), MAXAVAILABILITY*sizeof(UINT8));
|
||||
memcpy(&players[newplayernum].availabilities, R_GetSkinAvailabilities(false, skinnum), MAXAVAILABILITY*sizeof(UINT8));
|
||||
|
||||
players[newplayernum].splitscreenindex = 0;
|
||||
players[newplayernum].bot = true;
|
||||
|
|
|
|||
|
|
@ -714,11 +714,13 @@ void K_RetireBots(void)
|
|||
|
||||
if (usableskins > 0)
|
||||
{
|
||||
UINT8 index = P_RandomKey(PR_RULESCRAMBLE, usableskins);
|
||||
UINT8 index = P_RandomKey(PR_BOTS, usableskins);
|
||||
skinnum = grabskins[index];
|
||||
grabskins[index] = grabskins[--usableskins];
|
||||
}
|
||||
|
||||
memcpy(&bot->availabilities, R_GetSkinAvailabilities(false, skinnum), MAXAVAILABILITY*sizeof(UINT8));
|
||||
|
||||
bot->botvars.difficulty = newDifficulty;
|
||||
bot->botvars.diffincrease = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -185,13 +185,13 @@ void R_InitSkins(void)
|
|||
M_UpdateConditionSetsPending();
|
||||
}
|
||||
|
||||
UINT8 *R_GetSkinAvailabilities(boolean demolock, boolean forbots)
|
||||
UINT8 *R_GetSkinAvailabilities(boolean demolock, INT32 botforcecharacter)
|
||||
{
|
||||
UINT16 i;
|
||||
UINT8 shif, byte;
|
||||
INT32 skinid;
|
||||
static UINT8 responsebuffer[MAXAVAILABILITY];
|
||||
UINT8 defaultbotskin = R_BotDefaultSkin();
|
||||
const boolean forbots = (botforcecharacter != -1);
|
||||
|
||||
memset(&responsebuffer, 0, sizeof(responsebuffer));
|
||||
|
||||
|
|
@ -206,7 +206,7 @@ UINT8 *R_GetSkinAvailabilities(boolean demolock, boolean forbots)
|
|||
continue;
|
||||
|
||||
if ((forbots
|
||||
? (M_CheckNetUnlockByID(i) || skinid == defaultbotskin) // Assert the host's lock.
|
||||
? (M_CheckNetUnlockByID(i) || skinid == botforcecharacter) // Assert the host's lock.
|
||||
: gamedata->unlocked[i]) // Assert the local lock.
|
||||
!= true && !demolock)
|
||||
continue;
|
||||
|
|
@ -451,7 +451,7 @@ void SetPlayerSkinByNum(INT32 playernum, INT32 skinnum)
|
|||
|
||||
if (P_IsLocalPlayer(player))
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Requested skin %d not found\n"), skinnum);
|
||||
else if(server || IsPlayerAdmin(consoleplayer))
|
||||
else if (server || IsPlayerAdmin(consoleplayer))
|
||||
CONS_Alert(CONS_WARNING, "Player %d (%s) skin %d not found\n", playernum, player_names[playernum], skinnum);
|
||||
|
||||
SetSkin(player, GetPlayerDefaultSkin(playernum)); // not found put the eggman skin
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ void R_PatchSkins(UINT16 wadnum, boolean mainfile);
|
|||
// Access
|
||||
INT32 R_SkinAvailable(const char *name);
|
||||
boolean R_SkinUsable(INT32 playernum, INT32 skinnum, boolean demoskins);
|
||||
UINT8 *R_GetSkinAvailabilities(boolean demolock, boolean forbots);
|
||||
UINT8 *R_GetSkinAvailabilities(boolean demolock, INT32 botforcecharacter);
|
||||
|
||||
// Setting
|
||||
void SetPlayerSkin(INT32 playernum,const char *skinname);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue