Actually track lastfakeskin!

Tremendous whoopsie: turns out there's no code that actually saves it outside of netsync. This is now fixed.
Also now allows you to roll Eggman as your first skin, and doesn't cause immediate characterswaps for midgame joiners.
This commit is contained in:
toaster 2022-11-23 18:03:27 +00:00
parent 3ee8bbbfc4
commit c2183a626c
3 changed files with 15 additions and 1 deletions

View file

@ -2551,6 +2551,7 @@ void CL_ClearPlayer(INT32 playernum)
memset(&players[playernum], 0, sizeof (player_t));
players[playernum].followerskin = -1; // don't have a ghost follower
players[playernum].fakeskin = players[playernum].lastfakeskin = MAXSKINS; // don't avoid eggman
RemoveAdminPlayer(playernum); // don't stay admin after you're gone
}

View file

@ -1185,6 +1185,14 @@ void G_ConsGhostTic(INT32 playernum)
players[playernum].kartweight = ghostext[playernum].kartweight;
players[playernum].charflags = ghostext[playernum].charflags;
if (demo.skinlist[demo.currentskinid[playernum]].flags & SF_IRONMAN)
{
players[playernum].lastfakeskin = players[playernum].fakeskin;
players[playernum].fakeskin =
(ghostext[playernum].skinid == demo.currentskinid[playernum])
? MAXSKINS
: ghostext[playernum].skinid;
}
}
}

View file

@ -339,7 +339,12 @@ void SetPlayerSkinByNum(INT32 playernum, INT32 skinnum)
// Set mo skin but not player_t skin, for ironman
void SetFakePlayerSkin(player_t* player, INT32 skinid)
{
player->fakeskin = skinid;
if (player->fakeskin != skinid)
{
if (player->fakeskin != MAXSKINS)
player->lastfakeskin = player->fakeskin;
player->fakeskin = skinid;
}
if (demo.playback)
{