Merge branch 'nightsnoforce' into 'master'

Charsel tweaks

See merge request STJr/SRB2Internal!551
This commit is contained in:
MascaraSnake 2019-11-25 16:54:27 -05:00
commit 34baf101aa
1 changed files with 11 additions and 14 deletions

View File

@ -8334,16 +8334,12 @@ static void M_SetupChoosePlayer(INT32 choice)
{
INT32 skinnum;
UINT8 i;
UINT8 firstvalid = 255;
UINT8 lastvalid = 0;
UINT8 firstvalid = 255, lastvalid = 255;
boolean allowed = false;
char *and;
(void)choice;
if (!(mapheaderinfo[startmap-1]
&& (mapheaderinfo[startmap-1]->forcecharacter[0] != '\0'
|| (mapheaderinfo[startmap-1]->typeoflevel & TOL_NIGHTS)) // remove this later when everyone gets their own nights sprites, maybe
))
if (!mapheaderinfo[startmap-1] || mapheaderinfo[startmap-1]->forcecharacter[0] == '\0')
{
for (i = 0; i < 32; i++) // Handle charsels, availability, and unlocks.
{
@ -8353,6 +8349,8 @@ static void M_SetupChoosePlayer(INT32 choice)
if (and)
{
char firstskin[SKINNAMESIZE+1];
if (mapheaderinfo[startmap-1]->typeoflevel & TOL_NIGHTS) // skip tagteam characters for NiGHTS levels
continue;
strncpy(firstskin, description[i].skinname, (and - description[i].skinname));
firstskin[(and - description[i].skinname)] = '\0';
description[i].skinnum[0] = R_SkinAvailable(firstskin);
@ -8406,17 +8404,16 @@ static void M_SetupChoosePlayer(INT32 choice)
}
}
if (firstvalid != 255)
{ // One last bit of order we can't do in the iteration above.
description[firstvalid].prev = lastvalid;
description[lastvalid].next = firstvalid;
}
else // We're being forced into a specific character, so might as well just skip it.
if (firstvalid == lastvalid) // We're being forced into a specific character, so might as well just skip it.
{
M_ChoosePlayer(-1);
M_ChoosePlayer(firstvalid);
return;
}
// One last bit of order we can't do in the iteration above.
description[firstvalid].prev = lastvalid;
description[lastvalid].next = firstvalid;
M_ChangeMenuMusic("_chsel", true);
/* the menus suck -James */
@ -8743,7 +8740,7 @@ static void M_ChoosePlayer(INT32 choice)
UINT8 skinnum;
// skip this if forcecharacter or no characters available
if (choice == -1)
if (choice == 255)
{
skinnum = botskin = 0;
botingame = false;