* Fix something I neglected earlier when fixing Ghosts and Replays for 2.2 - the fact that the player's skin will change if they don't have NiGHTS sprites like Sonic does not being accomodated.

This commit is contained in:
toaster 2019-07-30 17:24:21 +01:00
parent 18e43a5cef
commit d541bb7ead
3 changed files with 12 additions and 3 deletions

View file

@ -4366,7 +4366,7 @@ void G_WriteGhostTic(mobj_t *ghost)
ghostext.flags = 0;
}
if (ghost->player && ghost->player->followmobj)
if (ghost->player && ghost->player->followmobj) // bloats tails runs but what can ya do
{
INT16 temp;
@ -4592,6 +4592,9 @@ void G_GhostTicker(void)
switch(g->color)
{
default:
case GHC_RETURNSKIN:
g->mo->skin = g->oldmo.skin;
// fallthru
case GHC_NORMAL: // Go back to skin color
g->mo->color = g->oldmo.color;
break;
@ -4602,6 +4605,9 @@ void G_GhostTicker(void)
case GHC_FIREFLOWER: // Fireflower
g->mo->color = SKINCOLOR_WHITE;
break;
case GHC_NIGHTSSKIN: // not actually a colour
g->mo->skin = &skins[DEFAULTNIGHTSSKIN];
break;
}
}
if (xziptic & EZT_FLIP)

View file

@ -140,7 +140,9 @@ typedef enum
GHC_NORMAL = 0,
GHC_SUPER,
GHC_FIREFLOWER,
GHC_INVINCIBLE
GHC_INVINCIBLE,
GHC_NIGHTSSKIN, // not actually a colour
GHC_RETURNSKIN // ditto
} ghostcolor_t;
// Record/playback tics

View file

@ -621,7 +621,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;
G_GhostAddColor(GHC_NORMAL);
G_GhostAddColor(GHC_RETURNSKIN);
// Restore aiming angle
if (player == &players[consoleplayer])
@ -739,6 +739,7 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime)
if (!(cv_debug || devparm) && !(netgame || multiplayer || demoplayback))
player->mo->color = skins[DEFAULTNIGHTSSKIN].prefcolor;
player->followitem = skins[DEFAULTNIGHTSSKIN].followitem;
G_GhostAddColor(GHC_NIGHTSSKIN);
}
player->nightstime = player->startedtime = player->lapstartedtime = nighttime*TICRATE;