mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-18 07:22:28 +00:00
Added gravflip support to lavafall, Pyre Fly and Pterabyte
This commit is contained in:
parent
a7d6ebd5bd
commit
357baeaa60
2 changed files with 7 additions and 8 deletions
|
@ -13820,7 +13820,8 @@ void A_FallingLavaCheck(mobj_t *actor)
|
|||
{
|
||||
actor->flags = MF_NOGRAVITY|MF_NOCLIPTHING;
|
||||
actor->momz = 0;
|
||||
actor->z = actor->watertop;
|
||||
if (actor->eflags & MFE_TOUCHWATER)
|
||||
actor->z = (actor->eflags & MFE_VERTICALFLIP) ? actor->waterbottom : actor->watertop;
|
||||
P_SetMobjState(actor, actor->info->deathstate);
|
||||
}
|
||||
}
|
||||
|
|
12
src/p_mobj.c
12
src/p_mobj.c
|
@ -9096,13 +9096,11 @@ void P_MobjThinker(mobj_t *mobj)
|
|||
|
||||
if (hdist < 1000*FRACUNIT)
|
||||
{
|
||||
fixed_t dist = P_AproxDistance(hdist, mobj->target->z - mobj->z);
|
||||
//Aim for player z position. If too close to floor/ceiling, aim just above/below them.
|
||||
fixed_t destz = min(max(mobj->target->z, mobj->target->floorz + 70*FRACUNIT), mobj->target->ceilingz - 80*FRACUNIT - mobj->height);
|
||||
fixed_t dist = P_AproxDistance(hdist, destz - mobj->z);
|
||||
P_InstaThrust(mobj, R_PointToAngle2(mobj->x, mobj->y, mobj->target->x, mobj->target->y), 2*FRACUNIT);
|
||||
//aim for player z position; if too close to floor, aim just above them
|
||||
if (mobj->z - mobj->floorz >= 80*FRACUNIT)
|
||||
mobj->momz = FixedMul(FixedDiv(mobj->target->z - mobj->z, dist), 2*FRACUNIT);
|
||||
else
|
||||
mobj->momz = FixedMul(FixedDiv((mobj->target->z + 70*FRACUNIT) - mobj->z, dist), 2*FRACUNIT);
|
||||
mobj->momz = FixedMul(FixedDiv(destz - mobj->z, dist), 2*FRACUNIT);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -9155,7 +9153,7 @@ void P_MobjThinker(mobj_t *mobj)
|
|||
}
|
||||
|
||||
vdist = mobj->z - mobj->target->z - mobj->target->height;
|
||||
if (vdist <= 0)
|
||||
if (P_MobjFlip(mobj)*vdist <= 0)
|
||||
{
|
||||
P_SetTarget(&mobj->target, NULL);
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue