mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-17 10:11:02 +00:00
Make it so you can't even STAND on spikes if you're flashing and moving away from them.
This commit is contained in:
parent
b2e92e7a09
commit
1e1d191a75
1 changed files with 7 additions and 7 deletions
14
src/p_map.c
14
src/p_map.c
|
@ -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);
|
||||||
|
|
Loading…
Reference in a new issue