Fix players being launched by slopes and pmomz when dying.

This commit is contained in:
toaster 2019-11-08 19:40:40 +00:00
parent b157c21a35
commit 24e5ccec0b
2 changed files with 6 additions and 1 deletions

View File

@ -2482,6 +2482,8 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget
P_UnsetThingPosition(target);
target->flags |= MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY;
P_SetThingPosition(target);
target->standingslope = NULL;
target->pmomz = 0;
if (target->player->powers[pw_super])
{

View File

@ -1861,6 +1861,9 @@ void P_XYMovement(mobj_t *mo)
oldy = mo->y;
#ifdef ESLOPE
if (mo->flags & MF_NOCLIPHEIGHT)
mo->standingslope = NULL;
// adjust various things based on slope
if (mo->standingslope && abs(mo->standingslope->zdelta) > FRACUNIT>>8) {
if (!P_IsObjectOnGround(mo)) { // We fell off at some point? Do the twisty thing!
@ -2051,7 +2054,7 @@ void P_XYMovement(mobj_t *mo)
return;
#ifdef ESLOPE
if (moved && oldslope) { // Check to see if we ran off
if (moved && oldslope && !(mo->flags & MF_NOCLIPHEIGHT)) { // Check to see if we ran off
if (oldslope != mo->standingslope) { // First, compare different slopes
angle_t oldangle, newangle;