From d1a6f4e8df9213a7a3cb9081b9d6e49d5fee245b Mon Sep 17 00:00:00 2001 From: SheepyChris Date: Thu, 17 Feb 2022 19:00:05 -0500 Subject: [PATCH] Fix inverted delta math and reorder Auto hitbox for projectile weapons --- src/hacks/Aimbot.cpp | 2 +- src/prediction.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hacks/Aimbot.cpp b/src/hacks/Aimbot.cpp index 287cd670..01eb3d7f 100644 --- a/src/hacks/Aimbot.cpp +++ b/src/hacks/Aimbot.cpp @@ -1437,7 +1437,7 @@ int BestHitbox(CachedEntity *target) if (target->hitboxes.VisibilityCheck(preferred)) return preferred; // Else attempt to find any hitbox at all - for (int i = projectile_mode ? 1 : 0; i < target->hitboxes.GetNumHitboxes() && i < 6; i++) + for (int i = 6; i > projectile_mode ? 1 : 0 && i < 6; i--) if (target->hitboxes.VisibilityCheck(i)) return i; } diff --git a/src/prediction.cpp b/src/prediction.cpp index ec3a039c..8e9e2c66 100644 --- a/src/prediction.cpp +++ b/src/prediction.cpp @@ -546,7 +546,7 @@ std::pair ProjectilePrediction_Engine(CachedEntity *ent, int hb, float rockettime = g_pLocalPlayer->v_Eye.DistTo(current) / speed; // Compensate for ping rockettime += g_IEngine->GetNetChannelInfo()->GetLatency(FLOW_OUTGOING) + cl_interp->GetFloat(); - float timedelta = fabs(rockettime - currenttime); + float timedelta = fabs(currenttime - rockettime); if (timedelta < mindelta) { besttime = currenttime; @@ -650,7 +650,7 @@ std::pair ProjectilePrediction(CachedEntity *ent, int hb, float float rockettime = g_pLocalPlayer->v_Eye.DistTo(current) / speed; // Compensate for ping rockettime += g_IEngine->GetNetChannelInfo()->GetLatency(FLOW_OUTGOING) + cl_interp->GetFloat(); - if (fabs(rockettime - currenttime) < mindelta) + if (fabs(currenttime - rockettime) < mindelta) { besttime = currenttime; bestpos = current;