Do death animation even when MF2_DONTDRAW is set
This commit is contained in:
parent
71a25eef92
commit
774ccad401
|
@ -3026,6 +3026,9 @@ static void P_KillPlayer(player_t *player, mobj_t *source, INT32 damage)
|
||||||
|
|
||||||
P_ResetPlayer(player);
|
P_ResetPlayer(player);
|
||||||
|
|
||||||
|
if (!player->spectator)
|
||||||
|
player->mo->flags2 &= ~MF2_DONTDRAW;
|
||||||
|
|
||||||
P_SetPlayerMobjState(player->mo, player->mo->info->deathstate);
|
P_SetPlayerMobjState(player->mo, player->mo->info->deathstate);
|
||||||
if (gametype == GT_CTF && (player->gotflag & (GF_REDFLAG|GF_BLUEFLAG)))
|
if (gametype == GT_CTF && (player->gotflag & (GF_REDFLAG|GF_BLUEFLAG)))
|
||||||
{
|
{
|
||||||
|
|
55
src/p_mobj.c
55
src/p_mobj.c
|
@ -7563,38 +7563,35 @@ void P_MobjThinker(mobj_t *mobj)
|
||||||
break;
|
break;
|
||||||
case MT_PLAYER:
|
case MT_PLAYER:
|
||||||
/// \todo Have the player's dead body completely finish its animation even if they've already respawned.
|
/// \todo Have the player's dead body completely finish its animation even if they've already respawned.
|
||||||
if (!(mobj->flags2 & MF2_DONTDRAW))
|
if (!mobj->fuse)
|
||||||
{
|
{ // Go away.
|
||||||
if (!mobj->fuse)
|
/// \todo Actually go ahead and remove mobj completely, and fix any bugs and crashes doing this creates. Chasecam should stop moving, and F12 should never return to it.
|
||||||
{ // Go away.
|
mobj->momz = 0;
|
||||||
/// \todo Actually go ahead and remove mobj completely, and fix any bugs and crashes doing this creates. Chasecam should stop moving, and F12 should never return to it.
|
if (mobj->player)
|
||||||
mobj->momz = 0;
|
mobj->flags2 |= MF2_DONTDRAW;
|
||||||
if (mobj->player)
|
else // safe to remove, nobody's going to complain!
|
||||||
mobj->flags2 |= MF2_DONTDRAW;
|
|
||||||
else // safe to remove, nobody's going to complain!
|
|
||||||
{
|
|
||||||
P_RemoveMobj(mobj);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else // Apply gravity to fall downwards.
|
|
||||||
{
|
{
|
||||||
if (mobj->player && !(mobj->fuse % 8) && (mobj->player->charflags & SF_MACHINE))
|
P_RemoveMobj(mobj);
|
||||||
{
|
return;
|
||||||
fixed_t r = mobj->radius>>FRACBITS;
|
|
||||||
mobj_t *explosion = P_SpawnMobj(
|
|
||||||
mobj->x + (P_RandomRange(r, -r)<<FRACBITS),
|
|
||||||
mobj->y + (P_RandomRange(r, -r)<<FRACBITS),
|
|
||||||
mobj->z + (P_RandomKey(mobj->height>>FRACBITS)<<FRACBITS),
|
|
||||||
MT_BOSSEXPLODE);
|
|
||||||
S_StartSound(explosion, sfx_cybdth);
|
|
||||||
}
|
|
||||||
if (mobj->movedir == DMG_DROWNED)
|
|
||||||
P_SetObjectMomZ(mobj, -FRACUNIT/2, true); // slower fall from drowning
|
|
||||||
else
|
|
||||||
P_SetObjectMomZ(mobj, -2*FRACUNIT/3, true);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else // Apply gravity to fall downwards.
|
||||||
|
{
|
||||||
|
if (mobj->player && !(mobj->fuse % 8) && (mobj->player->charflags & SF_MACHINE))
|
||||||
|
{
|
||||||
|
fixed_t r = mobj->radius >> FRACBITS;
|
||||||
|
mobj_t *explosion = P_SpawnMobj(
|
||||||
|
mobj->x + (P_RandomRange(r, -r) << FRACBITS),
|
||||||
|
mobj->y + (P_RandomRange(r, -r) << FRACBITS),
|
||||||
|
mobj->z + (P_RandomKey(mobj->height >> FRACBITS) << FRACBITS),
|
||||||
|
MT_BOSSEXPLODE);
|
||||||
|
S_StartSound(explosion, sfx_cybdth);
|
||||||
|
}
|
||||||
|
if (mobj->movedir == DMG_DROWNED)
|
||||||
|
P_SetObjectMomZ(mobj, -FRACUNIT / 2, true); // slower fall from drowning
|
||||||
|
else
|
||||||
|
P_SetObjectMomZ(mobj, -2 * FRACUNIT / 3, true);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue