From b84e9a4133106989ffb97054bf3428f5e7392edd Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Tue, 4 Sep 2018 18:47:30 -0400 Subject: [PATCH] Jawz ignores targets too high/low --- src/k_kart.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 3cfbed2c..1463ce03 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -3107,6 +3107,14 @@ player_t *K_FindJawzTarget(mobj_t *actor, player_t *source) if (G_GametypeHasTeams() && source->ctfteam == player->ctfteam) continue; + // Invisible, don't bother + if (player->kartstuff[k_hyudorotimer]) + continue; + + // Z pos too high/low + if (abs(player->mo->z - (actor->z + actor->momz)) > 48<angle - R_PointToAngle2(actor->x, actor->y, player->mo->x, player->mo->y); if (thisang > ANGLE_180) @@ -3134,8 +3142,7 @@ player_t *K_FindJawzTarget(mobj_t *actor, player_t *source) if (player->kartstuff[k_bumper] <= 0) continue; - thisdist = P_AproxDistance(P_AproxDistance(player->mo->x - (actor->x + actor->momx), - player->mo->y - (actor->y + actor->momy)), player->mo->z - (actor->z + actor->momz)); + thisdist = P_AproxDistance(player->mo->x - (actor->x + actor->momx), player->mo->y - (actor->y + actor->momy)); if (thisdist > RING_DIST) // Don't go for people who are too far away continue;