From 3802ec33de3738426a48f751205240314de36a51 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Tue, 23 Feb 2016 22:53:24 +0000 Subject: [PATCH] Fixed how dying players who were standing on slopes just jump off to the side --- src/p_map.c | 29 +++++++++++++++++------------ src/p_mobj.c | 14 ++++++++++++-- src/p_slopes.c | 3 +++ 3 files changed, 32 insertions(+), 14 deletions(-) diff --git a/src/p_map.c b/src/p_map.c index 7ff913a86..dff5c5bef 100644 --- a/src/p_map.c +++ b/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; diff --git a/src/p_mobj.c b/src/p_mobj.c index 65b5f9a09..155d985e9 100644 --- a/src/p_mobj.c +++ b/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 diff --git a/src/p_slopes.c b/src/p_slopes.c index 2d55cf194..797fe46b4 100644 --- a/src/p_slopes.c +++ b/src/p_slopes.c @@ -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