mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-03-23 03:12:38 +00:00
Do death animation even when MF2_DONTDRAW is set
This commit is contained in:
parent
71a25eef92
commit
774ccad401
2 changed files with 29 additions and 29 deletions
|
@ -3026,6 +3026,9 @@ static void P_KillPlayer(player_t *player, mobj_t *source, INT32 damage)
|
|||
|
||||
P_ResetPlayer(player);
|
||||
|
||||
if (!player->spectator)
|
||||
player->mo->flags2 &= ~MF2_DONTDRAW;
|
||||
|
||||
P_SetPlayerMobjState(player->mo, player->mo->info->deathstate);
|
||||
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;
|
||||
case MT_PLAYER:
|
||||
/// \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.
|
||||
/// \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.
|
||||
mobj->momz = 0;
|
||||
if (mobj->player)
|
||||
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->fuse)
|
||||
{ // Go away.
|
||||
/// \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.
|
||||
mobj->momz = 0;
|
||||
if (mobj->player)
|
||||
mobj->flags2 |= MF2_DONTDRAW;
|
||||
else // safe to remove, nobody's going to complain!
|
||||
{
|
||||
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);
|
||||
P_RemoveMobj(mobj);
|
||||
return;
|
||||
}
|
||||
}
|
||||
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;
|
||||
default:
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue