From 4bb21a4ca6bd860663eae90a1c6dd6aa2bbdda01 Mon Sep 17 00:00:00 2001 From: 8dcc <8dcc.git@gmail.com> Date: Mon, 31 Jul 2023 17:40:01 +0200 Subject: [PATCH] Fix fov calculations, fix aimbot head offset --- src/features/aim.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/features/aim.c b/src/features/aim.c index 29bf1ad..e6fff6c 100644 --- a/src/features/aim.c +++ b/src/features/aim.c @@ -7,7 +7,7 @@ #include "../include/util.h" /* Game units to add to the entity origin to get the head */ -#define HEAD_OFFSET 0.8f +#define HEAD_OFFSET 65.f /* Scale factor for aim punch */ #define AIM_PUNCH_MULT 2 @@ -61,11 +61,10 @@ static vec3_t get_closest_delta(vec3_t viewangles) { vec_norm(delta); float fov = hypotf(delta.x, delta.y); - if (fov > 360.0f) { + if (fov > 360.0f) fov = remainderf(fov, 360.0f); - if (fov > 180.0f) - fov = 360.0f - fov; - } + if (fov > 180.0f) + fov = 360.0f - fov; if (fov < best_fov) { best_fov = fov;