mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-12-21 07:22:33 +00:00
Merge branch 'switching-racers' into 'master'
Skin change condition tweak See merge request KartKrew/Kart!491
This commit is contained in:
commit
3e378ecd9b
2 changed files with 26 additions and 5 deletions
|
|
@ -1382,7 +1382,7 @@ UINT8 CanChangeSkin(INT32 playernum)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// Not in game, so you can change
|
// Not in game, so you can change
|
||||||
if (players[playernum].spectator || players[playernum].playerstate == PST_DEAD || players[playernum].playerstate == PST_REBORN)
|
if (players[playernum].spectator)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// Check for freeeplay
|
// Check for freeeplay
|
||||||
|
|
@ -1405,6 +1405,26 @@ UINT8 CanChangeSkin(INT32 playernum)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean CanChangeSkinWhilePlaying(INT32 playernum)
|
||||||
|
{
|
||||||
|
INT32 i;
|
||||||
|
|
||||||
|
// Force skin in effect.
|
||||||
|
if ((cv_forceskin.value != -1))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
@ -6070,7 +6090,7 @@ static void Skin_OnChange(void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CanChangeSkin(consoleplayer))
|
if (CanChangeSkinWhilePlaying(consoleplayer))
|
||||||
SendNameAndColor(0);
|
SendNameAndColor(0);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -6089,7 +6109,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]))
|
if (CanChangeSkinWhilePlaying(g_localplayers[1]))
|
||||||
SendNameAndColor(1);
|
SendNameAndColor(1);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -6103,7 +6123,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]))
|
if (CanChangeSkinWhilePlaying(g_localplayers[2]))
|
||||||
SendNameAndColor(2);
|
SendNameAndColor(2);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -6117,7 +6137,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]))
|
if (CanChangeSkinWhilePlaying(g_localplayers[3]))
|
||||||
SendNameAndColor(3);
|
SendNameAndColor(3);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -282,5 +282,6 @@ void LiveStudioAudience(void);
|
||||||
|
|
||||||
// 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
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue