mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-26 20:11:47 +00:00
Jawz ignores targets too high/low
This commit is contained in:
parent
be92535dba
commit
c46bf86bf3
1 changed files with 9 additions and 2 deletions
11
src/k_kart.c
11
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)
|
if (G_GametypeHasTeams() && source->ctfteam == player->ctfteam)
|
||||||
continue;
|
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<<FRACBITS)
|
||||||
|
continue;
|
||||||
|
|
||||||
// Find the angle, see who's got the best.
|
// Find the angle, see who's got the best.
|
||||||
thisang = actor->angle - R_PointToAngle2(actor->x, actor->y, player->mo->x, player->mo->y);
|
thisang = actor->angle - R_PointToAngle2(actor->x, actor->y, player->mo->x, player->mo->y);
|
||||||
if (thisang > ANGLE_180)
|
if (thisang > ANGLE_180)
|
||||||
|
|
@ -3134,8 +3142,7 @@ player_t *K_FindJawzTarget(mobj_t *actor, player_t *source)
|
||||||
if (player->kartstuff[k_bumper] <= 0)
|
if (player->kartstuff[k_bumper] <= 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
thisdist = P_AproxDistance(P_AproxDistance(player->mo->x - (actor->x + actor->momx),
|
thisdist = P_AproxDistance(player->mo->x - (actor->x + actor->momx), player->mo->y - (actor->y + actor->momy));
|
||||||
player->mo->y - (actor->y + actor->momy)), player->mo->z - (actor->z + actor->momz));
|
|
||||||
|
|
||||||
if (thisdist > RING_DIST) // Don't go for people who are too far away
|
if (thisdist > RING_DIST) // Don't go for people who are too far away
|
||||||
continue;
|
continue;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue