mirror of
https://github.com/ioquake/ioq3.git
synced 2024-11-10 07:11:46 +00:00
[game/ai_main.c] Use floating-point fabs() for floating-point values
This commit is contained in:
parent
c5c01e771a
commit
3c8da8ca07
1 changed files with 2 additions and 2 deletions
|
@ -781,7 +781,7 @@ void BotChangeViewAngles(bot_state_t *bs, float thinktime) {
|
|||
//
|
||||
if (bot_challenge.integer) {
|
||||
//smooth slowdown view model
|
||||
diff = abs(AngleDifference(bs->viewangles[i], bs->ideal_viewangles[i]));
|
||||
diff = fabs(AngleDifference(bs->viewangles[i], bs->ideal_viewangles[i]));
|
||||
anglespeed = diff * factor;
|
||||
if (anglespeed > maxchange) anglespeed = maxchange;
|
||||
bs->viewangles[i] = BotChangeViewAngle(bs->viewangles[i],
|
||||
|
@ -878,7 +878,7 @@ void BotInputToUserCommand(bot_input_t *bi, usercmd_t *ucmd, int delta_angles[3]
|
|||
//set the view independent movement
|
||||
f = DotProduct(forward, bi->dir);
|
||||
r = DotProduct(right, bi->dir);
|
||||
u = abs(forward[2]) * bi->dir[2];
|
||||
u = fabs(forward[2]) * bi->dir[2];
|
||||
m = fabs(f);
|
||||
|
||||
if (fabs(r) > m) {
|
||||
|
|
Loading…
Reference in a new issue