Merge pull request #213 from tkoeppe/abs

[game/ai_main.c] Use floating-point fabs() for floating-point values
This commit is contained in:
Tim Angus 2016-08-23 21:19:36 +01:00 committed by GitHub
commit 762f50757d

View file

@ -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) {