Use correct flavor of abs()

This commit is contained in:
Yamagi Burmeister 2014-08-03 11:29:47 +02:00
parent 8dd8520ddc
commit d8eb7037a4
3 changed files with 7 additions and 7 deletions

View file

@ -359,7 +359,7 @@ body_think(edict_t *self)
{ {
float r; float r;
if (abs(self->ideal_yaw - anglemod(self->s.angles[YAW])) < 2) if (fabsf(self->ideal_yaw - anglemod(self->s.angles[YAW])) < 2)
{ {
if (self->timestamp < level.time) if (self->timestamp < level.time)
{ {

View file

@ -714,7 +714,7 @@ SV_NewChaseDir(edict_t *actor, edict_t *enemy, float dist)
} }
/* try other directions */ /* try other directions */
if (((rand() & 3) & 1) || (abs(deltay) > abs(deltax))) if (((rand() & 3) & 1) || (fabsf(deltay) > fabsf(deltax)))
{ {
tdir = d[1]; tdir = d[1];
d[1] = d[2]; d[1] = d[2];

View file

@ -117,7 +117,7 @@ stalker_ok_to_transition(edict_t *self)
return false; return false;
} }
if (abs(end_height + margin - trace.endpos[2]) > 8) if (fabsf(end_height + margin - trace.endpos[2]) > 8)
{ {
return false; return false;
} }
@ -134,7 +134,7 @@ stalker_ok_to_transition(edict_t *self)
return false; return false;
} }
if (abs(end_height + margin - trace.endpos[2]) > 8) if (fabsf(end_height + margin - trace.endpos[2]) > 8)
{ {
return false; return false;
} }
@ -150,7 +150,7 @@ stalker_ok_to_transition(edict_t *self)
return false; return false;
} }
if (abs(end_height + margin - trace.endpos[2]) > 8) if (fabsf(end_height + margin - trace.endpos[2]) > 8)
{ {
return false; return false;
} }
@ -166,7 +166,7 @@ stalker_ok_to_transition(edict_t *self)
return false; return false;
} }
if (abs(end_height + margin - trace.endpos[2]) > 8) if (fabsf(end_height + margin - trace.endpos[2]) > 8)
{ {
return false; return false;
} }
@ -972,7 +972,7 @@ stalker_do_pounce(edict_t *self, vec3_t dest)
/* make sure we're pointing in that direction 15deg margin of error. */ /* make sure we're pointing in that direction 15deg margin of error. */
vectoangles2(dist, jumpAngles); vectoangles2(dist, jumpAngles);
if (abs(jumpAngles[YAW] - self->s.angles[YAW]) > 45) if (fabsf(jumpAngles[YAW] - self->s.angles[YAW]) > 45)
{ {
return false; /* not facing the player... */ return false; /* not facing the player... */
} }