mirror of
https://github.com/DrBeef/ioq3quest.git
synced 2024-11-10 23:02:01 +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) {
|
if (bot_challenge.integer) {
|
||||||
//smooth slowdown view model
|
//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;
|
anglespeed = diff * factor;
|
||||||
if (anglespeed > maxchange) anglespeed = maxchange;
|
if (anglespeed > maxchange) anglespeed = maxchange;
|
||||||
bs->viewangles[i] = BotChangeViewAngle(bs->viewangles[i],
|
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
|
//set the view independent movement
|
||||||
f = DotProduct(forward, bi->dir);
|
f = DotProduct(forward, bi->dir);
|
||||||
r = DotProduct(right, bi->dir);
|
r = DotProduct(right, bi->dir);
|
||||||
u = abs(forward[2]) * bi->dir[2];
|
u = fabs(forward[2]) * bi->dir[2];
|
||||||
m = fabs(f);
|
m = fabs(f);
|
||||||
|
|
||||||
if (fabs(r) > m) {
|
if (fabs(r) > m) {
|
||||||
|
|
Loading…
Reference in a new issue