mirror of
https://github.com/UberGames/lilium-voyager.git
synced 2024-11-10 06:31:47 +00:00
Merge pull request #213 from tkoeppe/abs
[game/ai_main.c] Use floating-point fabs() for floating-point values
This commit is contained in:
commit
762f50757d
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