mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-02-07 00:41:26 +00:00
Fixed how dying players who were standing on slopes just jump off to the side
This commit is contained in:
parent
3058648fdc
commit
3802ec33de
3 changed files with 32 additions and 14 deletions
|
@ -2051,6 +2051,8 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff)
|
||||||
thing->ceilingz = tmceilingz;
|
thing->ceilingz = tmceilingz;
|
||||||
|
|
||||||
#ifdef ESLOPE
|
#ifdef ESLOPE
|
||||||
|
if (!(thing->flags & MF_NOCLIPHEIGHT))
|
||||||
|
{
|
||||||
// Assign thing's standingslope if needed
|
// Assign thing's standingslope if needed
|
||||||
if (thing->z <= tmfloorz && !(thing->eflags & MFE_VERTICALFLIP)) {
|
if (thing->z <= tmfloorz && !(thing->eflags & MFE_VERTICALFLIP)) {
|
||||||
if (!startingonground && tmfloorslope)
|
if (!startingonground && tmfloorslope)
|
||||||
|
@ -2066,6 +2068,9 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff)
|
||||||
if (thing->momz >= 0)
|
if (thing->momz >= 0)
|
||||||
thing->standingslope = tmceilingslope;
|
thing->standingslope = tmceilingslope;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else // don't set standingslope if you're not going to clip against it
|
||||||
|
thing->standingslope = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
thing->x = x;
|
thing->x = x;
|
||||||
|
|
14
src/p_mobj.c
14
src/p_mobj.c
|
@ -2077,8 +2077,13 @@ static boolean P_ZMovement(mobj_t *mo)
|
||||||
I_Assert(!P_MobjWasRemoved(mo));
|
I_Assert(!P_MobjWasRemoved(mo));
|
||||||
|
|
||||||
#ifdef ESLOPE
|
#ifdef ESLOPE
|
||||||
if (mo->standingslope && !P_IsObjectOnGround(mo))
|
if (mo->standingslope)
|
||||||
|
{
|
||||||
|
if (mo->flags & MF_NOCLIPHEIGHT)
|
||||||
|
mo->standingslope = NULL;
|
||||||
|
else if (!P_IsObjectOnGround(mo))
|
||||||
P_SlopeLaunch(mo);
|
P_SlopeLaunch(mo);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Intercept the stupid 'fall through 3dfloors' bug
|
// Intercept the stupid 'fall through 3dfloors' bug
|
||||||
|
@ -2561,8 +2566,13 @@ static void P_PlayerZMovement(mobj_t *mo)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#ifdef ESLOPE
|
#ifdef ESLOPE
|
||||||
if (mo->standingslope && !P_IsObjectOnGround(mo))
|
if (mo->standingslope)
|
||||||
|
{
|
||||||
|
if (mo->flags & MF_NOCLIPHEIGHT)
|
||||||
|
mo->standingslope = NULL;
|
||||||
|
else if (!P_IsObjectOnGround(mo))
|
||||||
P_SlopeLaunch(mo);
|
P_SlopeLaunch(mo);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// clip movement
|
// clip movement
|
||||||
|
|
|
@ -1099,6 +1099,9 @@ void P_ButteredSlope(mobj_t *mo)
|
||||||
if (!mo->standingslope)
|
if (!mo->standingslope)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (mo->flags & (MF_NOCLIPHEIGHT|MF_NOGRAVITY))
|
||||||
|
return; // don't slide down slopes if you can't touch them or you're not affected by gravity
|
||||||
|
|
||||||
if (mo->player) {
|
if (mo->player) {
|
||||||
if (abs(mo->standingslope->zdelta) < FRACUNIT/4 && !(mo->player->pflags & PF_SPINNING))
|
if (abs(mo->standingslope->zdelta) < FRACUNIT/4 && !(mo->player->pflags & PF_SPINNING))
|
||||||
return; // Don't slide on non-steep slopes unless spinning
|
return; // Don't slide on non-steep slopes unless spinning
|
||||||
|
|
Loading…
Reference in a new issue