mirror of
https://github.com/yquake2/rogue.git
synced 2024-11-22 20:31:50 +00:00
Use correct flavor of abs()
This commit is contained in:
parent
8dd8520ddc
commit
d8eb7037a4
3 changed files with 7 additions and 7 deletions
|
@ -359,7 +359,7 @@ body_think(edict_t *self)
|
|||
{
|
||||
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)
|
||||
{
|
||||
|
|
|
@ -714,7 +714,7 @@ SV_NewChaseDir(edict_t *actor, edict_t *enemy, float dist)
|
|||
}
|
||||
|
||||
/* try other directions */
|
||||
if (((rand() & 3) & 1) || (abs(deltay) > abs(deltax)))
|
||||
if (((rand() & 3) & 1) || (fabsf(deltay) > fabsf(deltax)))
|
||||
{
|
||||
tdir = d[1];
|
||||
d[1] = d[2];
|
||||
|
|
|
@ -117,7 +117,7 @@ stalker_ok_to_transition(edict_t *self)
|
|||
return false;
|
||||
}
|
||||
|
||||
if (abs(end_height + margin - trace.endpos[2]) > 8)
|
||||
if (fabsf(end_height + margin - trace.endpos[2]) > 8)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -134,7 +134,7 @@ stalker_ok_to_transition(edict_t *self)
|
|||
return false;
|
||||
}
|
||||
|
||||
if (abs(end_height + margin - trace.endpos[2]) > 8)
|
||||
if (fabsf(end_height + margin - trace.endpos[2]) > 8)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -150,7 +150,7 @@ stalker_ok_to_transition(edict_t *self)
|
|||
return false;
|
||||
}
|
||||
|
||||
if (abs(end_height + margin - trace.endpos[2]) > 8)
|
||||
if (fabsf(end_height + margin - trace.endpos[2]) > 8)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -166,7 +166,7 @@ stalker_ok_to_transition(edict_t *self)
|
|||
return false;
|
||||
}
|
||||
|
||||
if (abs(end_height + margin - trace.endpos[2]) > 8)
|
||||
if (fabsf(end_height + margin - trace.endpos[2]) > 8)
|
||||
{
|
||||
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. */
|
||||
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... */
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue