Skip to content
This repository has been archived by the owner on Mar 9, 2024. It is now read-only.

Commit

Permalink
Request #265
Browse files Browse the repository at this point in the history
  • Loading branch information
swamptwink committed May 15, 2022
1 parent 82d4245 commit a95befb
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 2 deletions.
Expand Up @@ -12,7 +12,8 @@ enum struct ETargetType
{
UNKNOWN,
PLAYER,
BUILDING
BUILDING,
STICKY
};

enum struct ESortMethod
Expand Down
Expand Up @@ -186,6 +186,31 @@ bool CAimbotHitscan::GetTargets(CBaseEntity* pLocal, CBaseCombatWeapon* pWeapon)
}
}

if (Vars::Aimbot::Global::AimStickies.m_Var)
{
for (const auto& Projectile : g_EntityCache.GetGroup(EGroupType::WORLD_PROJECTILES))
{
if (!(Projectile->GetPipebombType() == TYPE_STICKY))
continue;

const auto owner = g_Interfaces.EntityList->GetClientEntityFromHandle(reinterpret_cast<int>(Projectile->GetThrower()));

if ((!Projectile->GetTouched()) || (owner->GetTeamNum() == pLocal->GetTeamNum()))
continue;

Vec3 vPos = Projectile->GetWorldSpaceCenter();
Vec3 vAngleTo = Math::CalcAngle(vLocalPos, vPos);
float flFOVTo = SortMethod == ESortMethod::FOV ? Math::CalcFov(vLocalAngles, vAngleTo) : 0.0f;

if (SortMethod == ESortMethod::FOV && flFOVTo > Vars::Aimbot::Global::AimFOV.m_Var)
continue;

float flDistTo = SortMethod == ESortMethod::DISTANCE ? vLocalPos.DistTo(vPos) : 0.0f;

g_AimbotGlobal.m_vecTargets.push_back({ Projectile, ETargetType::STICKY, vPos, vAngleTo, flFOVTo, flDistTo });
}
}

return !g_AimbotGlobal.m_vecTargets.empty();
}

Expand Down
Expand Up @@ -222,6 +222,7 @@ bool CConfigManager::SaveConfig(const std::string& configName)
SAVE_VAR(Vars::Aimbot::Global::AutoShoot);
SAVE_VAR(Vars::Aimbot::Global::AimPlayers);
SAVE_VAR(Vars::Aimbot::Global::AimBuildings);
SAVE_VAR(Vars::Aimbot::Global::AimStickies);
SAVE_VAR(Vars::Aimbot::Global::IgnoreInvlunerable);
SAVE_VAR(Vars::Aimbot::Global::IgnoreCloaked);
SAVE_VAR(Vars::Aimbot::Global::IgnoreFriends);
Expand Down Expand Up @@ -935,6 +936,7 @@ bool CConfigManager::LoadConfig(const std::string& configName)
LOAD_VAR(Vars::Aimbot::Global::AutoShoot);
LOAD_VAR(Vars::Aimbot::Global::AimPlayers);
LOAD_VAR(Vars::Aimbot::Global::AimBuildings);
LOAD_VAR(Vars::Aimbot::Global::AimStickies);
LOAD_VAR(Vars::Aimbot::Global::IgnoreInvlunerable);
LOAD_VAR(Vars::Aimbot::Global::IgnoreCloaked);
LOAD_VAR(Vars::Aimbot::Global::IgnoreFriends);
Expand Down
Expand Up @@ -245,7 +245,7 @@ void CMenu::MenuAimbot()
WSlider("Aimbot FoV####AimbotFoV", &Vars::Aimbot::Global::AimFOV.m_Var, 0.f, 180.f, "%.f", ImGuiSliderFlags_AlwaysClamp);
ColorPickerL("Aimbot FOV circle", Colors::FOVCircle);
WToggle("Autoshoot###AimbotAutoshoot", &Vars::Aimbot::Global::AutoShoot.m_Var); HelpMarker("Automatically shoot when a target is found");
MultiCombo({ "Players", "Buildings" }, { &Vars::Aimbot::Global::AimPlayers.m_Var, &Vars::Aimbot::Global::AimBuildings.m_Var }, "Aim targets");
MultiCombo({ "Players", "Buildings", "Stickies"}, {&Vars::Aimbot::Global::AimPlayers.m_Var, &Vars::Aimbot::Global::AimBuildings.m_Var, &Vars::Aimbot::Global::AimStickies.m_Var}, "Aim targets");
HelpMarker("Choose which targets the Aimbot should aim at");
MultiCombo({ "Invulnerable", "Cloaked", "Friends", "Taunting" }, { &Vars::Aimbot::Global::IgnoreInvlunerable.m_Var, &Vars::Aimbot::Global::IgnoreCloaked.m_Var, &Vars::Aimbot::Global::IgnoreFriends.m_Var, &Vars::Aimbot::Global::IgnoreTaunting.m_Var }, "Ignored targets###HitscanIgnoredTargets");
HelpMarker("Choose which targets should be ignored");
Expand Down
1 change: 1 addition & 0 deletions Fedoraware/TeamFortress2/TeamFortress2/Features/Vars.h
Expand Up @@ -82,6 +82,7 @@ namespace Vars
inline CVar<bool> AutoShoot{ true, L"Auto Shoot" };
inline CVar<bool> AimPlayers{ true, L"Aim Players" };
inline CVar<bool> AimBuildings{ true, L"Aim Buildings" };
inline CVar<bool> AimStickies{ true };
inline CVar<bool> IgnoreInvlunerable{ true, L"Ignore Invulnerable" };
inline CVar<bool> IgnoreCloaked{ false, L"Ignore Cloaked" };
inline CVar<bool> IgnoreFriends{ true, L"Ignore Friends" };
Expand Down

0 comments on commit a95befb

Please sign in to comment.