Make it so you can't even STAND on spikes if you're flashing and moving away from them.

This commit is contained in:
toasterbabe 2017-07-30 16:52:39 +01:00
parent b2e92e7a09
commit 1e1d191a75

View file

@ -986,6 +986,13 @@ static boolean PIT_CheckThing(mobj_t *thing)
else if (thing->type == MT_WALLSPIKE && thing->flags & MF_SOLID && tmthing->player) else if (thing->type == MT_WALLSPIKE && thing->flags & MF_SOLID && tmthing->player)
{ {
fixed_t bottomz, topz; fixed_t bottomz, topz;
angle_t touchangle = R_PointToAngle2(thing->tracer->x, thing->tracer->y, tmthing->x, tmthing->y);
if (P_PlayerInPain(tmthing->player)
&& (tmthing->momx || tmthing->momy)
&& (R_PointToAngle2(0, 0, tmthing->momx, tmthing->momy) - touchangle) > ANGLE_180)
return true; // Yes, this is intentionally outside the z-height check. No standing on spikes whilst moving away from them.
bottomz = thing->z; bottomz = thing->z;
topz = thing->z + thing->height; topz = thing->z + thing->height;
@ -998,13 +1005,6 @@ static boolean PIT_CheckThing(mobj_t *thing)
&& tmthing->z < topz // below top && tmthing->z < topz // below top
&& !P_MobjWasRemoved(thing->tracer)) // this probably wouldn't work if we didn't have a tracer && !P_MobjWasRemoved(thing->tracer)) // this probably wouldn't work if we didn't have a tracer
{ // use base as a reference point to determine what angle you touched the spike at { // use base as a reference point to determine what angle you touched the spike at
angle_t touchangle = R_PointToAngle2(thing->tracer->x, thing->tracer->y, tmthing->x, tmthing->y);
if (P_PlayerInPain(tmthing->player)
&& (tmthing->momx || tmthing->momy)
&& (R_PointToAngle2(0, 0, tmthing->momx, tmthing->momy) - touchangle) > ANGLE_180)
return true;
touchangle = thing->angle - touchangle; touchangle = thing->angle - touchangle;
if (touchangle > ANGLE_180) if (touchangle > ANGLE_180)
touchangle = InvAngle(touchangle); touchangle = InvAngle(touchangle);