Don't use way too low charge aimbot range and fix targeting issues
This commit is contained in:
parent
f3a5175c1e
commit
1cb16f9855
@ -2,5 +2,5 @@
|
|||||||
#include "common.hpp"
|
#include "common.hpp"
|
||||||
namespace hacks::tf2::misc_aimbot
|
namespace hacks::tf2::misc_aimbot
|
||||||
{
|
{
|
||||||
std::pair<CachedEntity *, Vector> FindBestEnt(bool teammate, bool Predict, bool zcheck, bool fov_check, float range = 600.0f);
|
std::pair<CachedEntity *, Vector> FindBestEnt(bool teammate, bool Predict, bool zcheck, bool fov_check, float range = 1500.0f);
|
||||||
}
|
}
|
||||||
|
@ -19,12 +19,17 @@ static settings::Int sandwichaim_aimkey_mode{ "sandwichaim.aimkey-mode", "0" };
|
|||||||
float sandwich_speed = 350.0f;
|
float sandwich_speed = 350.0f;
|
||||||
float grav = 0.25f;
|
float grav = 0.25f;
|
||||||
int prevent = -1;
|
int prevent = -1;
|
||||||
|
static Timer previous_entity_delay{};
|
||||||
|
|
||||||
|
// TODO: Refactor this jank
|
||||||
std::pair<CachedEntity *, Vector> FindBestEnt(bool teammate, bool Predict, bool zcheck, bool fov_check, float range)
|
std::pair<CachedEntity *, Vector> FindBestEnt(bool teammate, bool Predict, bool zcheck, bool fov_check, float range)
|
||||||
{
|
{
|
||||||
CachedEntity *bestent = nullptr;
|
CachedEntity *bestent = nullptr;
|
||||||
float bestscr = FLT_MAX;
|
float bestscr = FLT_MAX;
|
||||||
Vector predicted{};
|
Vector predicted{};
|
||||||
|
// Too long since we focused it
|
||||||
|
if (previous_entity_delay.check(100))
|
||||||
|
prevent = -1;
|
||||||
for (int i = 0; i < 1; i++)
|
for (int i = 0; i < 1; i++)
|
||||||
{
|
{
|
||||||
if (prevent != -1)
|
if (prevent != -1)
|
||||||
@ -32,7 +37,7 @@ std::pair<CachedEntity *, Vector> FindBestEnt(bool teammate, bool Predict, bool
|
|||||||
auto ent = ENTITY(prevent);
|
auto ent = ENTITY(prevent);
|
||||||
if (CE_BAD(ent) || !ent->m_bAlivePlayer() || (teammate && ent->m_iTeam() != LOCAL_E->m_iTeam()) || ent == LOCAL_E)
|
if (CE_BAD(ent) || !ent->m_bAlivePlayer() || (teammate && ent->m_iTeam() != LOCAL_E->m_iTeam()) || ent == LOCAL_E)
|
||||||
continue;
|
continue;
|
||||||
if (!teammate && ent->m_iTeam() == LOCAL_E->m_ItemType())
|
if (!teammate && ent->m_iTeam() == LOCAL_E->m_iTeam())
|
||||||
continue;
|
continue;
|
||||||
if (!ent->hitboxes.GetHitbox(1))
|
if (!ent->hitboxes.GetHitbox(1))
|
||||||
continue;
|
continue;
|
||||||
@ -69,8 +74,11 @@ std::pair<CachedEntity *, Vector> FindBestEnt(bool teammate, bool Predict, bool
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (bestent && predicted.z)
|
if (bestent && predicted.z)
|
||||||
|
{
|
||||||
|
previous_entity_delay.update();
|
||||||
return { bestent, predicted };
|
return { bestent, predicted };
|
||||||
}
|
}
|
||||||
|
}
|
||||||
prevent = -1;
|
prevent = -1;
|
||||||
for (int i = 0; i <= g_IEngine->GetMaxClients(); i++)
|
for (int i = 0; i <= g_IEngine->GetMaxClients(); i++)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user