Fix fov calculations, fix aimbot head offset
This commit is contained in:
parent
51c302f492
commit
4bb21a4ca6
|
@ -7,7 +7,7 @@
|
||||||
#include "../include/util.h"
|
#include "../include/util.h"
|
||||||
|
|
||||||
/* Game units to add to the entity origin to get the head */
|
/* 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 */
|
/* Scale factor for aim punch */
|
||||||
#define AIM_PUNCH_MULT 2
|
#define AIM_PUNCH_MULT 2
|
||||||
|
@ -61,11 +61,10 @@ static vec3_t get_closest_delta(vec3_t viewangles) {
|
||||||
vec_norm(delta);
|
vec_norm(delta);
|
||||||
|
|
||||||
float fov = hypotf(delta.x, delta.y);
|
float fov = hypotf(delta.x, delta.y);
|
||||||
if (fov > 360.0f) {
|
if (fov > 360.0f)
|
||||||
fov = remainderf(fov, 360.0f);
|
fov = remainderf(fov, 360.0f);
|
||||||
if (fov > 180.0f)
|
if (fov > 180.0f)
|
||||||
fov = 360.0f - fov;
|
fov = 360.0f - fov;
|
||||||
}
|
|
||||||
|
|
||||||
if (fov < best_fov) {
|
if (fov < best_fov) {
|
||||||
best_fov = fov;
|
best_fov = fov;
|
||||||
|
|
Loading…
Reference in New Issue