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

View file

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