summaryrefslogtreecommitdiffstats
path: root/src/esp.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/esp.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/esp.cpp b/src/esp.cpp
index bd3fbdb..2987508 100644
--- a/src/esp.cpp
+++ b/src/esp.cpp
@@ -417,15 +417,25 @@ bool aimbot_apply(CUserCmd *cmd) {
417 } 417 }
418 418
419 // Refine to the actual head hitbox/bone for the chosen target only. 419 // Refine to the actual head hitbox/bone for the chosen target only.
420 bool exact_head = false;
420 void *best_ent = entitylist_get(best_idx); 421 void *best_ent = entitylist_get(best_idx);
421 if (best_ent && bones_update(best_idx, best_ent)) { 422 if (best_ent && bones_update(best_idx, best_ent)) {
422 Vector head; 423 Vector head;
423 if (head_position(best_idx, head) && 424 if (head_position(best_idx, head) &&
424 getfov(view, angle_to(g_cam_eye, head)) <= MAX_FOV) 425 getfov(view, angle_to(g_cam_eye, head)) <= MAX_FOV) {
425 best_head = head; 426 best_head = head;
427 exact_head = true;
428 }
426 } 429 }
427 430
428 QAngle desired = angle_to(g_cam_eye, best_head); 431 QAngle desired = angle_to(g_cam_eye, best_head);
432 static int want_logs = 0;
433 if (want_logs < 10) {
434 want_logs++;
435 logf("aimbot: head=(%.1f %.1f %.1f) exact=%d want=%.2f/%.2f",
436 best_head.x, best_head.y, best_head.z, (int)exact_head, desired.x,
437 desired.y);
438 }
429 float dp = desired.x - cmd->viewangles[0]; 439 float dp = desired.x - cmd->viewangles[0];
430 float dy = desired.y - cmd->viewangles[1]; 440 float dy = desired.y - cmd->viewangles[1];
431 while (dy > 180.0f) dy -= 360.0f; 441 while (dy > 180.0f) dy -= 360.0f;