diff --git a/src/p_enemy.c b/src/p_enemy.c index 7db2ace39..fe9a6e178 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -8272,7 +8272,7 @@ void A_Boss3ShockThink(mobj_t *actor) fixed_t x0, y0, x1, y1; // Break the link if movements are too different - if (FixedHypot(snext->momx - actor->momx, snext->momy - actor->momy) > 12*actor->scale) + if (R_PointToDist2(0, 0, snext->momx - actor->momx, snext->momy - actor->momy) > 12*actor->scale) { P_SetTarget(&actor->hnext, NULL); return; @@ -8283,9 +8283,11 @@ void A_Boss3ShockThink(mobj_t *actor) y0 = actor->y; x1 = snext->x; y1 = snext->y; - if (FixedHypot(x1 - x0, y1 - y0) > 2*actor->radius) + if (R_PointToDist2(0, 0, x1 - x0, y1 - y0) > 2*actor->radius) { - snew = P_SpawnMobj((x0 + x1) >> 1, (y0 + y1) >> 1, (actor->z + snext->z) >> 1, actor->type); + snew = P_SpawnMobj((x0 >> 1) + (x1 >> 1), + (y0 >> 1) + (y1 >> 1), + (actor->z >> 1) + (snext->z >> 1), actor->type); snew->momx = (actor->momx + snext->momx) >> 1; snew->momy = (actor->momy + snext->momy) >> 1; snew->momz = (actor->momz + snext->momz) >> 1; // is this really needed?