[botlib] Use floating point absolute value rather than truncate to integer
This commit is contained in:
parent
9a5add2b60
commit
18d6c8fda2
5 changed files with 9 additions and 8 deletions
|
@ -390,9 +390,9 @@ int AAS_NearestEntity(vec3_t origin, int modelindex)
|
|||
ent = &aasworld.entities[i];
|
||||
if (ent->i.modelindex != modelindex) continue;
|
||||
VectorSubtract(ent->i.origin, origin, dir);
|
||||
if (abs(dir[0]) < 40)
|
||||
if (fabsf(dir[0]) < 40)
|
||||
{
|
||||
if (abs(dir[1]) < 40)
|
||||
if (fabsf(dir[1]) < 40)
|
||||
{
|
||||
dist = VectorLength(dir);
|
||||
if (dist < bestdist)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue