Prevent non-CA2_SPINDASH characters from getting crushed by roll-jumping into a crevice
This commit is contained in:
parent
b059ed40c6
commit
87968c946b
38
src/p_user.c
38
src/p_user.c
|
@ -8614,6 +8614,7 @@ void P_MovePlayer(player_t *player)
|
||||||
P_DoFiring(player, cmd);
|
P_DoFiring(player, cmd);
|
||||||
|
|
||||||
{
|
{
|
||||||
|
boolean atspinheight = false;
|
||||||
fixed_t oldheight = player->mo->height;
|
fixed_t oldheight = player->mo->height;
|
||||||
|
|
||||||
// Less height while spinning. Good for spinning under things...?
|
// Less height while spinning. Good for spinning under things...?
|
||||||
|
@ -8623,32 +8624,35 @@ void P_MovePlayer(player_t *player)
|
||||||
|| player->powers[pw_tailsfly] || player->pflags & PF_GLIDING
|
|| player->powers[pw_tailsfly] || player->pflags & PF_GLIDING
|
||||||
|| (player->charability == CA_GLIDEANDCLIMB && player->mo->state-states == S_PLAY_GLIDE_LANDING)
|
|| (player->charability == CA_GLIDEANDCLIMB && player->mo->state-states == S_PLAY_GLIDE_LANDING)
|
||||||
|| (player->charability == CA_FLY && player->mo->state-states == S_PLAY_FLY_TIRED))
|
|| (player->charability == CA_FLY && player->mo->state-states == S_PLAY_FLY_TIRED))
|
||||||
|
{
|
||||||
player->mo->height = P_GetPlayerSpinHeight(player);
|
player->mo->height = P_GetPlayerSpinHeight(player);
|
||||||
|
atspinheight = true;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
player->mo->height = P_GetPlayerHeight(player);
|
player->mo->height = P_GetPlayerHeight(player);
|
||||||
|
|
||||||
if (player->mo->eflags & MFE_VERTICALFLIP && player->mo->height != oldheight) // adjust z height for reverse gravity, similar to how it's done for scaling
|
if (player->mo->eflags & MFE_VERTICALFLIP && player->mo->height != oldheight) // adjust z height for reverse gravity, similar to how it's done for scaling
|
||||||
player->mo->z -= player->mo->height - oldheight;
|
player->mo->z -= player->mo->height - oldheight;
|
||||||
}
|
|
||||||
|
|
||||||
// Crush test...
|
// Crush test...
|
||||||
if ((player->mo->ceilingz - player->mo->floorz < player->mo->height)
|
if ((player->mo->ceilingz - player->mo->floorz < player->mo->height)
|
||||||
&& !(player->mo->flags & MF_NOCLIP))
|
&& !(player->mo->flags & MF_NOCLIP))
|
||||||
{
|
|
||||||
if ((player->charability2 == CA2_SPINDASH) && !(player->pflags & PF_SPINNING))
|
|
||||||
{
|
{
|
||||||
player->pflags |= PF_SPINNING;
|
if (!atspinheight)
|
||||||
P_SetPlayerMobjState(player->mo, S_PLAY_ROLL);
|
{
|
||||||
}
|
player->pflags |= PF_SPINNING;
|
||||||
else if (player->mo->ceilingz - player->mo->floorz < player->mo->height)
|
P_SetPlayerMobjState(player->mo, S_PLAY_ROLL);
|
||||||
{
|
}
|
||||||
if ((netgame || multiplayer) && player->spectator)
|
else if (player->mo->ceilingz - player->mo->floorz < player->mo->height)
|
||||||
P_DamageMobj(player->mo, NULL, NULL, 1, DMG_SPECTATOR); // Respawn crushed spectators
|
{
|
||||||
else
|
if ((netgame || multiplayer) && player->spectator)
|
||||||
P_DamageMobj(player->mo, NULL, NULL, 1, DMG_CRUSHED);
|
P_DamageMobj(player->mo, NULL, NULL, 1, DMG_SPECTATOR); // Respawn crushed spectators
|
||||||
|
else
|
||||||
|
P_DamageMobj(player->mo, NULL, NULL, 1, DMG_CRUSHED);
|
||||||
|
|
||||||
if (player->playerstate == PST_DEAD)
|
if (player->playerstate == PST_DEAD)
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue