mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-18 07:22:28 +00:00
Don't change player->skincolor and cv_playercolor to the team color
This commit is contained in:
parent
f27ea0169f
commit
9bdc333539
9 changed files with 30 additions and 65 deletions
|
@ -1071,7 +1071,6 @@ static inline void AM_drawPlayers(void)
|
|||
return;
|
||||
}
|
||||
|
||||
// multiplayer (how??)
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
if (!playeringame[i] || players[i].spectator)
|
||||
|
|
|
@ -1221,13 +1221,6 @@ static void SendNameAndColor(void)
|
|||
|
||||
p = buf;
|
||||
|
||||
// normal player colors
|
||||
if (G_GametypeHasTeams())
|
||||
{
|
||||
if (players[consoleplayer].ctfteam != 0 && cv_playercolor.value != G_GetTeamColor(players[consoleplayer].ctfteam))
|
||||
CV_StealthSetValue(&cv_playercolor, G_GetTeamColor(players[consoleplayer].ctfteam));
|
||||
}
|
||||
|
||||
// don't allow inaccessible colors
|
||||
if (!skincolors[cv_playercolor.value].accessible)
|
||||
{
|
||||
|
@ -1353,13 +1346,6 @@ static void SendNameAndColor2(void)
|
|||
else // HACK
|
||||
secondplaya = 1;
|
||||
|
||||
// normal player colors
|
||||
if (G_GametypeHasTeams())
|
||||
{
|
||||
if (players[secondplaya].ctfteam != 0 && cv_playercolor2.value != G_GetTeamColor(players[secondplaya].ctfteam))
|
||||
CV_StealthSetValue(&cv_playercolor2, G_GetTeamColor(players[secondplaya].ctfteam));
|
||||
}
|
||||
|
||||
// don't allow inaccessible colors
|
||||
if (!skincolors[cv_playercolor2.value].accessible)
|
||||
{
|
||||
|
@ -1482,7 +1468,7 @@ static void Got_NameAndColor(UINT8 **cp, INT32 playernum)
|
|||
// set color
|
||||
p->skincolor = color % numskincolors;
|
||||
if (p->mo)
|
||||
p->mo->color = (UINT16)p->skincolor;
|
||||
p->mo->color = P_GetPlayerColor(p);
|
||||
|
||||
// normal player colors
|
||||
if (server && (p != &players[consoleplayer] && p != &players[secondarydisplayplayer]))
|
||||
|
@ -1491,13 +1477,6 @@ static void Got_NameAndColor(UINT8 **cp, INT32 playernum)
|
|||
UINT32 unlockShift = 0;
|
||||
UINT32 i;
|
||||
|
||||
// team colors
|
||||
if (G_GametypeHasTeams())
|
||||
{
|
||||
if (p->ctfteam != 0 && p->skincolor != G_GetTeamColor(p->ctfteam))
|
||||
kick = true;
|
||||
}
|
||||
|
||||
// don't allow inaccessible colors
|
||||
if (skincolors[p->skincolor].accessible == false)
|
||||
kick = true;
|
||||
|
@ -2962,17 +2941,6 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
|
|||
displayplayer = consoleplayer;
|
||||
}
|
||||
|
||||
if (G_GametypeHasTeams())
|
||||
{
|
||||
if (players[playernum].ctfteam)
|
||||
{
|
||||
if (playernum == consoleplayer) //CTF and Team Match colors.
|
||||
CV_SetValue(&cv_playercolor, G_GetTeamColor(players[playernum].ctfteam));
|
||||
else if (playernum == secondarydisplayplayer)
|
||||
CV_SetValue(&cv_playercolor2, G_GetTeamColor(players[playernum].ctfteam));
|
||||
}
|
||||
}
|
||||
|
||||
// In tag, check to see if you still have a game.
|
||||
if (G_TagGametype())
|
||||
P_CheckSurvivors();
|
||||
|
|
12
src/g_game.c
12
src/g_game.c
|
@ -2745,18 +2745,6 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
|
|||
//if ((netgame || multiplayer) && !p->spectator) -- moved into P_SpawnPlayer to account for forced changes there
|
||||
//p->powers[pw_flashing] = flashingtics-1; // Babysitting deterrent
|
||||
|
||||
// Check to make sure their color didn't change somehow...
|
||||
if (G_GametypeHasTeams())
|
||||
{
|
||||
if (p->ctfteam != 0 && p->skincolor != G_GetTeamColor(p->ctfteam))
|
||||
{
|
||||
if (p == &players[consoleplayer])
|
||||
CV_SetValue(&cv_playercolor, G_GetTeamColor(p->ctfteam));
|
||||
else if (p == &players[secondarydisplayplayer])
|
||||
CV_SetValue(&cv_playercolor2, G_GetTeamColor(p->ctfteam));
|
||||
}
|
||||
}
|
||||
|
||||
if (betweenmaps)
|
||||
return;
|
||||
|
||||
|
|
|
@ -5248,7 +5248,7 @@ void A_SignPlayer(mobj_t *actor)
|
|||
return;
|
||||
|
||||
skin = &skins[actor->target->player->skin];
|
||||
facecolor = actor->target->player->skincolor;
|
||||
facecolor = P_GetPlayerColor(actor->target->player);
|
||||
|
||||
if (signcolor)
|
||||
;
|
||||
|
@ -9059,7 +9059,7 @@ void A_Dye(mobj_t *actor)
|
|||
if (!color)
|
||||
{
|
||||
target->colorized = false;
|
||||
target->color = target->player ? target->player->skincolor : SKINCOLOR_NONE;
|
||||
target->color = target->player ? P_GetPlayerColor(target->player) : SKINCOLOR_NONE;
|
||||
}
|
||||
else if (!(target->player))
|
||||
{
|
||||
|
|
|
@ -2632,7 +2632,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget
|
|||
}
|
||||
}
|
||||
|
||||
target->color = target->player->skincolor;
|
||||
target->color = P_GetPlayerColor(target->player);
|
||||
target->colorized = false;
|
||||
G_GhostAddColor(GHC_NORMAL);
|
||||
|
||||
|
@ -3325,7 +3325,7 @@ static void P_KillPlayer(player_t *player, mobj_t *source, INT32 damage)
|
|||
|
||||
// Get rid of shield
|
||||
player->powers[pw_shield] = SH_NONE;
|
||||
player->mo->color = player->skincolor;
|
||||
player->mo->color = P_GetPlayerColor(player);
|
||||
|
||||
// Get rid of emeralds
|
||||
player->powers[pw_emeralds] = 0;
|
||||
|
@ -3442,7 +3442,7 @@ void P_RemoveShield(player_t *player)
|
|||
{ // Second layer shields
|
||||
if (((player->powers[pw_shield] & SH_STACK) == SH_FIREFLOWER) && !(player->powers[pw_super] || (mariomode && player->powers[pw_invulnerability])))
|
||||
{
|
||||
player->mo->color = player->skincolor;
|
||||
player->mo->color = P_GetPlayerColor(player);
|
||||
G_GhostAddColor(GHC_NORMAL);
|
||||
}
|
||||
player->powers[pw_shield] = SH_NONE;
|
||||
|
|
|
@ -147,6 +147,7 @@ boolean P_PlayerFullbright(player_t *player);
|
|||
boolean P_PlayerCanEnterSpinGaps(player_t *player);
|
||||
boolean P_PlayerShouldUseSpinHeight(player_t *player);
|
||||
boolean P_PlayerHasTeamFlag(player_t *player, UINT8 team);
|
||||
UINT16 P_GetPlayerColor(player_t *player);
|
||||
|
||||
boolean P_IsObjectInGoop(mobj_t *mo);
|
||||
boolean P_IsObjectOnGround(mobj_t *mo);
|
||||
|
|
|
@ -11557,7 +11557,6 @@ void P_SpawnPlayer(INT32 playernum)
|
|||
// Spawn as a spectator,
|
||||
// yes even in splitscreen mode
|
||||
p->spectator = true;
|
||||
p->skincolor = teams[newteam].color;
|
||||
|
||||
// but immediately send a team change packet.
|
||||
NetPacket.packet.playernum = playernum;
|
||||
|
@ -11582,11 +11581,6 @@ void P_SpawnPlayer(INT32 playernum)
|
|||
else
|
||||
p->ctfteam = 1;
|
||||
}
|
||||
|
||||
// Fix team colors.
|
||||
// This code isn't being done right somewhere else. Oh well.
|
||||
if (p->ctfteam != 0)
|
||||
p->skincolor = G_GetTeamColor(p->ctfteam);
|
||||
}
|
||||
|
||||
if ((netgame || multiplayer) && ((gametyperules & GTR_SPAWNINVUL) || leveltime) && !p->spectator && !(maptol & TOL_NIGHTS))
|
||||
|
@ -11598,7 +11592,7 @@ void P_SpawnPlayer(INT32 playernum)
|
|||
mobj->angle = 0;
|
||||
|
||||
// set color translations for player sprites
|
||||
mobj->color = p->skincolor;
|
||||
mobj->color = P_GetPlayerColor(p);
|
||||
|
||||
// set 'spritedef' override in mobj for player skins.. (see ProjectSprite)
|
||||
// (usefulness: when body mobj is detached from player (who respawns),
|
||||
|
|
20
src/p_user.c
20
src/p_user.c
|
@ -686,7 +686,7 @@ static void P_DeNightserizePlayer(player_t *player)
|
|||
|
||||
player->mo->skin = &skins[player->skin];
|
||||
player->followitem = skins[player->skin].followitem;
|
||||
player->mo->color = player->skincolor;
|
||||
player->mo->color = P_GetPlayerColor(player);
|
||||
G_GhostAddColor(GHC_RETURNSKIN);
|
||||
|
||||
// Restore aiming angle
|
||||
|
@ -3023,7 +3023,7 @@ static void P_CheckInvincibilityTimer(player_t *player)
|
|||
}
|
||||
else
|
||||
{
|
||||
player->mo->color = player->skincolor;
|
||||
player->mo->color = P_GetPlayerColor(player);
|
||||
G_GhostAddColor(GHC_NORMAL);
|
||||
}
|
||||
}
|
||||
|
@ -4300,7 +4300,7 @@ static void P_DoSuperStuff(player_t *player)
|
|||
}
|
||||
else
|
||||
{
|
||||
player->mo->color = player->skincolor;
|
||||
player->mo->color = P_GetPlayerColor(player);
|
||||
G_GhostAddColor(GHC_NORMAL);
|
||||
}
|
||||
|
||||
|
@ -4350,7 +4350,7 @@ static void P_DoSuperStuff(player_t *player)
|
|||
}
|
||||
else
|
||||
{
|
||||
player->mo->color = player->skincolor;
|
||||
player->mo->color = P_GetPlayerColor(player);
|
||||
G_GhostAddColor(GHC_NORMAL);
|
||||
}
|
||||
|
||||
|
@ -13094,3 +13094,15 @@ boolean P_PlayerHasTeamFlag(player_t *player, UINT8 team)
|
|||
|
||||
return player->gotflag & teams[team].flag;
|
||||
}
|
||||
|
||||
UINT16 P_GetPlayerColor(player_t *player)
|
||||
{
|
||||
if (G_GametypeHasTeams() && player->ctfteam)
|
||||
{
|
||||
UINT16 skincolor = G_GetTeamColor(player->ctfteam);
|
||||
if (skincolor != SKINCOLOR_NONE)
|
||||
return skincolor;
|
||||
}
|
||||
|
||||
return player->skincolor;
|
||||
}
|
||||
|
|
|
@ -843,6 +843,8 @@ static void ST_drawLivesArea(void)
|
|||
V_DrawSmallScaledPatch(hudinfo[HUD_LIVES].x, hudinfo[HUD_LIVES].y,
|
||||
hudinfo[HUD_LIVES].f|V_PERPLAYER|V_HUDTRANS, livesback);
|
||||
|
||||
UINT16 facecolor = P_GetPlayerColor(stplyr);
|
||||
|
||||
// face
|
||||
if (stplyr->spectator)
|
||||
{
|
||||
|
@ -872,10 +874,10 @@ static void ST_drawLivesArea(void)
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (stplyr->skincolor)
|
||||
else if (facecolor)
|
||||
{
|
||||
// skincolor face
|
||||
UINT8 *colormap = R_GetTranslationColormap(stplyr->skin, stplyr->skincolor, GTC_CACHE);
|
||||
UINT8 *colormap = R_GetTranslationColormap(stplyr->skin, facecolor, GTC_CACHE);
|
||||
V_DrawSmallMappedPatch(hudinfo[HUD_LIVES].x, hudinfo[HUD_LIVES].y,
|
||||
hudinfo[HUD_LIVES].f|V_PERPLAYER|V_HUDTRANS, faceprefix[stplyr->skin], colormap);
|
||||
}
|
||||
|
@ -1038,7 +1040,8 @@ static void ST_drawLivesArea(void)
|
|||
|
||||
static void ST_drawInput(void)
|
||||
{
|
||||
const INT32 accent = V_SNAPTOLEFT|V_SNAPTOBOTTOM|(stplyr->skincolor ? skincolors[stplyr->skincolor].ramp[4] : 0);
|
||||
UINT16 color = P_GetPlayerColor(stplyr);
|
||||
const INT32 accent = V_SNAPTOLEFT|V_SNAPTOBOTTOM|(color ? skincolors[color].ramp[4] : 0);
|
||||
INT32 col;
|
||||
UINT8 offs;
|
||||
|
||||
|
|
Loading…
Reference in a new issue