FlickyFly: Configure gravity by MTF_AMBUSH

This commit is contained in:
mazmazz 2018-08-09 00:13:08 -04:00
parent 21cb0cab3c
commit fc2517d8e2

View file

@ -10884,9 +10884,14 @@ void P_InternalFlickyFly(mobj_t *actor, fixed_t flyspeed, fixed_t targetdist, fi
if (actor->target && abs(chasez - actor->z) > targetdist)
targetdist = P_AproxDistance(actor->target->x - actor->x, actor->target->y - actor->y);
vertangle = (R_PointToAngle2(0, actor->z, targetdist, chasez) >> ANGLETOFINESHIFT) & FINEMASK;
P_InstaThrust(actor, actor->angle, FixedMul(FINECOSINE(vertangle), flyspeed));
actor->momz = FixedMul(FINESINE(vertangle), flyspeed);
if (actor->spawnpoint && (actor->spawnpoint->options & MTF_AMBUSH))
actor->momz = 0;
else
{
vertangle = (R_PointToAngle2(0, actor->z, targetdist, chasez) >> ANGLETOFINESHIFT) & FINEMASK;
P_InstaThrust(actor, actor->angle, FixedMul(FINECOSINE(vertangle), flyspeed));
actor->momz = FixedMul(FINESINE(vertangle), flyspeed);
}
}
// Function: A_FlickyFly
@ -11636,4 +11641,4 @@ void A_CheckFlags2(mobj_t *actor)
if (actor->flags2 & locvar1)
P_SetMobjState(actor, (statenum_t)locvar2);
}
}