Meanwhile, setting crouchsprite on the fly will not be honoured by this check and you end up with the squashed PLAY* sprite instead of whatever you had specified.
EDIT: For reference, here is the code as it is now:
Code: Select all
// Set the crouch sprite?
if (player->crouchfactor < 0.75)
{
if (spritenum == actor->SpawnState->sprite || spritenum == player->mo->crouchsprite)
{
crouchspriteno = player->mo->crouchsprite;
}
else if (!(actor->flags4 & MF4_NOSKIN) &&
(spritenum == Skins[player->userinfo.GetSkin()].sprite ||
spritenum == Skins[player->userinfo.GetSkin()].crouchsprite))
{
crouchspriteno = Skins[player->userinfo.GetSkin()].crouchsprite;
}
else
{ // no sprite -> squash the existing one
crouchspriteno = -1;
}
if (crouchspriteno > 0)
{
spritenum = crouchspriteno;
}
else if (player->playerstate != PST_DEAD && player->crouchfactor < 0.75)
{
scale.Y *= 0.5;
}
}