* Scope tweakin's to prevent having to make some stuff static.

* Make wallspikes intangible if you're being thrust away from them in pain.
This commit is contained in:
toasterbabe 2017-07-18 14:17:10 +01:00
parent a5477737d7
commit d1be22ccf5

View file

@ -990,10 +990,15 @@ static boolean PIT_CheckThing(mobj_t *thing)
&& !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); angle_t touchangle = R_PointToAngle2(thing->tracer->x, thing->tracer->y, tmthing->x, tmthing->y);
angle_t diffangle = thing->angle - touchangle;
if (diffangle > ANGLE_180) if (P_PlayerInPain(tmthing->player)
diffangle = InvAngle(diffangle); && (R_PointToAngle2(0, 0, tmthing->momx, tmthing->momy) - touchangle) > ANGLE_180)
if (diffangle <= ANGLE_22h) // if you touched it at this close an angle, you get poked! return true;
touchangle = thing->angle - touchangle;
if (touchangle > ANGLE_180)
touchangle = InvAngle(touchangle);
if (touchangle <= ANGLE_22h) // if you touched it at this close an angle, you get poked!
P_DamageMobj(tmthing, thing, thing, 1, DMG_SPIKE); P_DamageMobj(tmthing, thing, thing, 1, DMG_SPIKE);
} }
} }
@ -3094,7 +3099,10 @@ void P_SlideMove(mobj_t *mo)
fixed_t leadx, leady, trailx, traily, newx, newy; fixed_t leadx, leady, trailx, traily, newx, newy;
INT16 hitcount = 0; INT16 hitcount = 0;
boolean success = false; boolean success = false;
boolean papercol = false; boolean papercol = false;
vertex_t v1, v2; // fake vertexes
line_t junk; // fake linedef
if (tmhitthing && mo->z + mo->height > tmhitthing->z && mo->z < tmhitthing->z + tmhitthing->height) if (tmhitthing && mo->z + mo->height > tmhitthing->z && mo->z < tmhitthing->z + tmhitthing->height)
{ {
@ -3104,11 +3112,7 @@ void P_SlideMove(mobj_t *mo)
if (tmhitthing->flags & MF_PAPERCOLLISION) if (tmhitthing->flags & MF_PAPERCOLLISION)
{ {
fixed_t cosradius, sinradius; fixed_t cosradius, sinradius, num, den;
vertex_t v1, v2; // fake vertexes
line_t junk; // fake linedef - does this need to be static? toast does not know
fixed_t num, den;
// trace along the three leading corners // trace along the three leading corners
if (mo->momx > 0) if (mo->momx > 0)