Let players switch skin at any time (even when moving) if they are playing alone

Playing in local splitscreen also counts as "alone".

Actually removes the restriction of only being able to
change skin when not moving altogether. It's annoying,
especially if you're getting bullied in POSITION.
This commit is contained in:
James R 2021-12-12 03:51:00 -08:00
parent f9abe3f2e4
commit 041dd73555
3 changed files with 25 additions and 8 deletions

View file

@ -1298,6 +1298,22 @@ UINT8 CanChangeSkin(INT32 playernum)
return true; return true;
} }
boolean CanChangeSkinWhilePlaying(INT32 playernum)
{
INT32 i;
for (i = 0; i < MAXPLAYERS; ++i)
{
if (D_IsPlayerHumanAndGaming(i) &&
!P_IsLocalPlayer(&players[i]))
{
return CanChangeSkin(playernum);
}
}
return true;
}
static void ForceAllSkins(INT32 forcedskin) static void ForceAllSkins(INT32 forcedskin)
{ {
INT32 i, j; INT32 i, j;
@ -5442,7 +5458,7 @@ static void Skin_OnChange(void)
return; return;
} }
if (CanChangeSkin(consoleplayer) && !P_PlayerMoving(consoleplayer)) if (CanChangeSkinWhilePlaying(consoleplayer))
SendNameAndColor(0); SendNameAndColor(0);
else else
{ {
@ -5461,7 +5477,7 @@ static void Skin2_OnChange(void)
if (!Playing() || !splitscreen) if (!Playing() || !splitscreen)
return; // do whatever you want return; // do whatever you want
if (CanChangeSkin(g_localplayers[1]) && !P_PlayerMoving(g_localplayers[1])) if (CanChangeSkinWhilePlaying(g_localplayers[1]))
SendNameAndColor(1); SendNameAndColor(1);
else else
{ {
@ -5475,7 +5491,7 @@ static void Skin3_OnChange(void)
if (!Playing() || splitscreen < 2) if (!Playing() || splitscreen < 2)
return; // do whatever you want return; // do whatever you want
if (CanChangeSkin(g_localplayers[2]) && !P_PlayerMoving(g_localplayers[2])) if (CanChangeSkinWhilePlaying(g_localplayers[2]))
SendNameAndColor(2); SendNameAndColor(2);
else else
{ {
@ -5489,7 +5505,7 @@ static void Skin4_OnChange(void)
if (!Playing() || splitscreen < 3) if (!Playing() || splitscreen < 3)
return; // do whatever you want return; // do whatever you want
if (CanChangeSkin(g_localplayers[3]) && !P_PlayerMoving(g_localplayers[3])) if (CanChangeSkinWhilePlaying(g_localplayers[3]))
SendNameAndColor(3); SendNameAndColor(3);
else else
{ {

View file

@ -225,5 +225,6 @@ void D_SetPassword(const char *pw);
// used for the player setup menu // used for the player setup menu
UINT8 CanChangeSkin(INT32 playernum); UINT8 CanChangeSkin(INT32 playernum);
boolean CanChangeSkinWhilePlaying(INT32 playernum);
#endif #endif

View file

@ -9866,7 +9866,7 @@ static void M_SetupMultiPlayer(INT32 choice)
break; break;
// disable skin changes if we can't actually change skins // disable skin changes if we can't actually change skins
if (!CanChangeSkin(consoleplayer)) if (!CanChangeSkinWhilePlaying(consoleplayer))
MP_PlayerSetupMenu[2].status = (IT_GRAYEDOUT); MP_PlayerSetupMenu[2].status = (IT_GRAYEDOUT);
else else
MP_PlayerSetupMenu[2].status = (IT_KEYHANDLER|IT_STRING); MP_PlayerSetupMenu[2].status = (IT_KEYHANDLER|IT_STRING);
@ -9909,7 +9909,7 @@ static void M_SetupMultiPlayer2(INT32 choice)
break; break;
// disable skin changes if we can't actually change skins // disable skin changes if we can't actually change skins
if (splitscreen && !CanChangeSkin(g_localplayers[1])) if (splitscreen && !CanChangeSkinWhilePlaying(g_localplayers[1]))
MP_PlayerSetupMenu[2].status = (IT_GRAYEDOUT); MP_PlayerSetupMenu[2].status = (IT_GRAYEDOUT);
else else
MP_PlayerSetupMenu[2].status = (IT_KEYHANDLER | IT_STRING); MP_PlayerSetupMenu[2].status = (IT_KEYHANDLER | IT_STRING);
@ -9952,7 +9952,7 @@ static void M_SetupMultiPlayer3(INT32 choice)
break; break;
// disable skin changes if we can't actually change skins // disable skin changes if we can't actually change skins
if (splitscreen > 1 && !CanChangeSkin(g_localplayers[2])) if (splitscreen > 1 && !CanChangeSkinWhilePlaying(g_localplayers[2]))
MP_PlayerSetupMenu[2].status = (IT_GRAYEDOUT); MP_PlayerSetupMenu[2].status = (IT_GRAYEDOUT);
else else
MP_PlayerSetupMenu[2].status = (IT_KEYHANDLER | IT_STRING); MP_PlayerSetupMenu[2].status = (IT_KEYHANDLER | IT_STRING);
@ -9995,7 +9995,7 @@ static void M_SetupMultiPlayer4(INT32 choice)
break; break;
// disable skin changes if we can't actually change skins // disable skin changes if we can't actually change skins
if (splitscreen > 2 && !CanChangeSkin(g_localplayers[3])) if (splitscreen > 2 && !CanChangeSkinWhilePlaying(g_localplayers[3]))
MP_PlayerSetupMenu[2].status = (IT_GRAYEDOUT); MP_PlayerSetupMenu[2].status = (IT_GRAYEDOUT);
else else
MP_PlayerSetupMenu[2].status = (IT_KEYHANDLER | IT_STRING); MP_PlayerSetupMenu[2].status = (IT_KEYHANDLER | IT_STRING);