mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-11-15 01:01:43 +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
29
src/p_map.c
29
src/p_map.c
|
@ -2051,21 +2051,26 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff)
|
|||
thing->ceilingz = tmceilingz;
|
||||
|
||||
#ifdef ESLOPE
|
||||
// Assign thing's standingslope if needed
|
||||
if (thing->z <= tmfloorz && !(thing->eflags & MFE_VERTICALFLIP)) {
|
||||
if (!startingonground && tmfloorslope)
|
||||
P_HandleSlopeLanding(thing, tmfloorslope);
|
||||
if (!(thing->flags & MF_NOCLIPHEIGHT))
|
||||
{
|
||||
// Assign thing's standingslope if needed
|
||||
if (thing->z <= tmfloorz && !(thing->eflags & MFE_VERTICALFLIP)) {
|
||||
if (!startingonground && tmfloorslope)
|
||||
P_HandleSlopeLanding(thing, tmfloorslope);
|
||||
|
||||
if (thing->momz <= 0)
|
||||
thing->standingslope = tmfloorslope;
|
||||
}
|
||||
else if (thing->z+thing->height >= tmceilingz && (thing->eflags & MFE_VERTICALFLIP)) {
|
||||
if (!startingonground && tmceilingslope)
|
||||
P_HandleSlopeLanding(thing, tmceilingslope);
|
||||
if (thing->momz <= 0)
|
||||
thing->standingslope = tmfloorslope;
|
||||
}
|
||||
else if (thing->z+thing->height >= tmceilingz && (thing->eflags & MFE_VERTICALFLIP)) {
|
||||
if (!startingonground && tmceilingslope)
|
||||
P_HandleSlopeLanding(thing, tmceilingslope);
|
||||
|
||||
if (thing->momz >= 0)
|
||||
thing->standingslope = tmceilingslope;
|
||||
if (thing->momz >= 0)
|
||||
thing->standingslope = tmceilingslope;
|
||||
}
|
||||
}
|
||||
else // don't set standingslope if you're not going to clip against it
|
||||
thing->standingslope = NULL;
|
||||
#endif
|
||||
|
||||
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));
|
||||
|
||||
#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);
|
||||
}
|
||||
#endif
|
||||
|
||||
// Intercept the stupid 'fall through 3dfloors' bug
|
||||
|
@ -2561,8 +2566,13 @@ static void P_PlayerZMovement(mobj_t *mo)
|
|||
return;
|
||||
|
||||
#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);
|
||||
}
|
||||
#endif
|
||||
|
||||
// clip movement
|
||||
|
|
|
@ -1099,6 +1099,9 @@ void P_ButteredSlope(mobj_t *mo)
|
|||
if (!mo->standingslope)
|
||||
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 (abs(mo->standingslope->zdelta) < FRACUNIT/4 && !(mo->player->pflags & PF_SPINNING))
|
||||
return; // Don't slide on non-steep slopes unless spinning
|
||||
|
|
Loading…
Reference in a new issue