Polish up Jawz target conditions slightly

This commit is contained in:
Sally Coolatta 2022-09-25 12:14:21 -04:00
parent bbec083d4e
commit 13e94dfee0

View file

@ -7151,6 +7151,8 @@ player_t *K_FindJawzTarget(mobj_t *actor, player_t *source, angle_t range)
continue; continue;
} }
thisdist = P_AproxDistance(player->mo->x - (actor->x + actor->momx), player->mo->y - (actor->y + actor->momy));
if (gametyperules & GTR_CIRCUIT) if (gametyperules & GTR_CIRCUIT)
{ {
if (player->position > source->position) if (player->position > source->position)
@ -7168,7 +7170,13 @@ player_t *K_FindJawzTarget(mobj_t *actor, player_t *source, angle_t range)
} }
// Z pos too high/low // Z pos too high/low
if (abs(player->mo->z - (actor->z + actor->momz)) > RING_DIST/8) if (abs(player->mo->z - (actor->z + actor->momz)) > FixedMul(RING_DIST/8, mapobjectscale))
{
continue;
}
// Distance too far away
if (thisdist > FixedMul(RING_DIST*2, mapobjectscale))
{ {
continue; continue;
} }
@ -7183,14 +7191,6 @@ player_t *K_FindJawzTarget(mobj_t *actor, player_t *source, angle_t range)
continue; continue;
} }
thisdist = P_AproxDistance(player->mo->x - (actor->x + actor->momx), player->mo->y - (actor->y + actor->momy));
// Don't go for people who are too far away
if (thisdist > 2*RING_DIST)
{
continue;
}
thisScore = (AngleFixed(thisang) * 2) + (thisdist / 2); thisScore = (AngleFixed(thisang) * 2) + (thisdist / 2);
//CONS_Printf("got score %f from player # %d\n", FixedToFloat(thisScore), i); //CONS_Printf("got score %f from player # %d\n", FixedToFloat(thisScore), i);