diff --git a/.gitignore b/.gitignore index 3a246a1f..a252d6a6 100755 --- a/.gitignore +++ b/.gitignore @@ -248,8 +248,6 @@ ModelManifest.xml *.d .settings/* - -CMakeCache.txt CMakeFiles CMakeScripts Testing diff --git a/src/hacks/Aimbot.cpp b/src/hacks/Aimbot.cpp index eed89c9c..dbe320aa 100644 --- a/src/hacks/Aimbot.cpp +++ b/src/hacks/Aimbot.cpp @@ -1241,12 +1241,12 @@ int BestHitbox(CachedEntity *target) if (data) { if (*backtrackVischeckAll) - for (int j = 0; j < 18; j++) + for (int j = head; j < foot_R + 1; j++) { if (IsEntityVectorVisible(target, (*data).hitboxes[j].center)) return j; } - else if (IsEntityVectorVisible(target, (*data).hitboxes[0].center)) + else if (IsEntityVectorVisible(target, (*data).hitboxes.at(head).center)) return 0; } // Nothing found, falling through to further below @@ -1254,19 +1254,7 @@ int BestHitbox(CachedEntity *target) else if (target->hitboxes.VisibilityCheck(preferred)) return preferred; // Else attempt to find any hitbox at all - if (shouldBacktrack()) - { - // We already vischecked - if (!*backtrackVischeckAll) - { - auto data = hacks::tf2::backtrack::getClosestEntTick(target, LOCAL_E->m_vecOrigin(), aimbotTickFilter); - - for (int i = 0; i < 18; i++) - if (IsEntityVectorVisible(target, (*data).hitboxes.at(i).center)) - return i; - } - } - else + if (!shouldBacktrack()) for (int i = projectile_mode ? 1 : 0; i < target->hitboxes.GetNumHitboxes() && i < 6; i++) { if (target->hitboxes.VisibilityCheck(i)) diff --git a/src/hacks/Backtrack.cpp b/src/hacks/Backtrack.cpp index 61785ba9..6e9c5bab 100644 --- a/src/hacks/Backtrack.cpp +++ b/src/hacks/Backtrack.cpp @@ -4,6 +4,7 @@ * */ #include "Backtrack.hpp" +#include "PlayerTools.hpp" #include "memory" namespace hacks::tf2::backtrack @@ -150,7 +151,7 @@ void CreateMove() return; } - // Only return here if the local player hasn't spawned in yet (so ping does not go down when dead) + // Return if local entity is bad (Still have backtrack run while dead so ping does not fluctuate heavily) if (CE_BAD(LOCAL_E)) { latency_rampup = 0.0f; @@ -454,7 +455,7 @@ std::optional getBestTick(CachedEntity *ent, std::functionm_IDX <= 0 || backtrack_data.size() < ent->m_IDX || !backtrack_data.at(ent->m_IDX - 1)) - return best_tick; + return std::nullopt; // Let the callback do the lifting for (auto &tick : getGoodTicks(ent->m_IDX)) @@ -481,8 +482,8 @@ bool defaultEntFilter(CachedEntity *ent) // Dormant if (CE_BAD(ent)) return false; - // Friend check - if (playerlist::IsFriend(ent)) + // Should we even target them + if (!player_tools::shouldTarget(ent)) return false; return true; } diff --git a/src/hacks/NavBot.cpp b/src/hacks/NavBot.cpp index 99086e1e..ffb557c3 100644 --- a/src/hacks/NavBot.cpp +++ b/src/hacks/NavBot.cpp @@ -255,7 +255,7 @@ void update_building_spots() // Stores valid areas, the float is the minimum distance away from enemies, needed for sorting later std::vector areas; - for (int i = 0; i <= g_IEngine->GetMaxClients(); i++) + for (int i = 1; i <= g_IEngine->GetMaxClients(); i++) { CachedEntity *ent = ENTITY(i); // Grab only Enemies and only if they are in soundcache