Add an extra fix for the "get hit the moment you spawn an orbiting item" bug that produced tiny Orbinauts and Jawz - now it moves them out so they're not inside you when you come out of hitlag.

(Yes, sorry, no more fishsticks.)
This commit is contained in:
toaster 2022-02-27 17:37:39 +00:00
parent 329c2a60a2
commit 5a06239a20

View file

@ -5637,6 +5637,17 @@ void K_DropHnextList(player_t *player, boolean keepshields)
if (orbit) // splay out
{
if (dropwork->destscale > work->destscale)
{
fixed_t radius = FixedMul(work->info->radius, dropwork->destscale);
radius = FixedHypot(player->mo->radius, player->mo->radius) + FixedHypot(radius, radius); // mobj's distance from its Target, or Radius.
dropwork->flags |= MF_NOCLIPTHING;
work->momx = FixedMul(FINECOSINE(work->angle>>ANGLETOFINESHIFT), radius);
work->momy = FixedMul(FINESINE(work->angle>>ANGLETOFINESHIFT), radius);
P_MoveOrigin(dropwork, player->mo->x + work->momx, player->mo->y + work->momy, player->mo->z);
dropwork->flags &= ~MF_NOCLIPTHING;
}
dropwork->flags2 |= MF2_AMBUSH;
dropwork->z += flip;