underpredict lob angle shots by default

fixes
This commit is contained in:
rei-2
2026-04-10 23:18:22 -04:00
parent 8862bfee0b
commit be74d8dc90
25 changed files with 542 additions and 455 deletions
@@ -14,19 +14,19 @@ static inline std::vector<Target_t> GetTargets(CTFPlayer* pLocal, CTFWeaponBase*
Vec3 vLocalAngles = I::EngineClient->GetViewAngles();
{
auto eGroupType = EntityEnum::Invalid;
auto eGroup = EntityEnum::Invalid;
if (Vars::Aimbot::General::Target.Value & Vars::Aimbot::General::TargetEnum::Players)
{
eGroupType = !F::AimbotGlobal.FriendlyFire() || Vars::Aimbot::General::Ignore.Value & Vars::Aimbot::General::IgnoreEnum::Team ? EntityEnum::PlayerEnemy : EntityEnum::PlayerAll;
eGroup = !F::AimbotGlobal.FriendlyFire() || Vars::Aimbot::General::Ignore.Value & Vars::Aimbot::General::IgnoreEnum::Team ? EntityEnum::PlayerEnemy : EntityEnum::PlayerAll;
if (Vars::Aimbot::Hitscan::Modifiers.Value & Vars::Aimbot::Hitscan::ModifiersEnum::ExtinguishTeam &&
!F::AimbotGlobal.FriendlyFire() && SDK::AttribHookValue(0, "jarate_duration", pWeapon) > 0)
eGroupType = EntityEnum::PlayerAll;
eGroup = EntityEnum::PlayerAll;
}
if (pWeapon->GetWeaponID() == TF_WEAPON_MEDIGUN)
eGroupType = Vars::Aimbot::Healing::AutoHeal.Value ? EntityEnum::PlayerTeam : EntityEnum::Invalid;
eGroup = Vars::Aimbot::Healing::AutoHeal.Value ? EntityEnum::PlayerTeam : EntityEnum::Invalid;
bool bHeal = pWeapon->GetWeaponID() == TF_WEAPON_MEDIGUN;
for (auto pEntity : H::Entities.GetGroup(eGroupType))
for (auto pEntity : H::Entities.GetGroup(eGroup))
{
if (F::AimbotGlobal.ShouldIgnore(pEntity, pLocal, pWeapon))
continue;
@@ -656,7 +656,7 @@ bool CAimbotHitscan::Aim(Vec3 vCurAngle, Vec3 vToAngle, Vec3& vOut, int iMethod)
}
// assume angle calculated outside with other overload
void CAimbotHitscan::Aim(CUserCmd* pCmd, Vec3& vAngle, int iMethod)
void CAimbotHitscan::Aim(CUserCmd* pCmd, Vec3& vAngles, int iMethod)
{
bool bUnsure = F::Ticks.IsTimingUnsure();
switch (iMethod)
@@ -667,20 +667,20 @@ void CAimbotHitscan::Aim(CUserCmd* pCmd, Vec3& vAngle, int iMethod)
[[fallthrough]];
case Vars::Aimbot::General::AimTypeEnum::Smooth:
case Vars::Aimbot::General::AimTypeEnum::Assistive:
pCmd->viewangles = vAngle;
I::EngineClient->SetViewAngles(vAngle);
pCmd->viewangles = vAngles;
I::EngineClient->SetViewAngles(vAngles);
break;
case Vars::Aimbot::General::AimTypeEnum::Silent:
if (G::Attacking == 1 || bUnsure)
{
SDK::FixMovement(pCmd, vAngle);
pCmd->viewangles = vAngle;
SDK::FixMovement(pCmd, vAngles);
pCmd->viewangles = vAngles;
G::SilentAngles = true;
}
break;
case Vars::Aimbot::General::AimTypeEnum::Locking:
SDK::FixMovement(pCmd, vAngle);
pCmd->viewangles = vAngle;
SDK::FixMovement(pCmd, vAngles);
pCmd->viewangles = vAngles;
G::SilentAngles = true;
}
}
@@ -10,7 +10,7 @@ private:
int CanHit(Target_t& tTarget, CTFPlayer* pLocal, CTFWeaponBase* pWeapon);
bool Aim(Vec3 vCurAngle, Vec3 vToAngle, Vec3& vOut, int iMethod = Vars::Aimbot::General::AimType.Value);
void Aim(CUserCmd* pCmd, Vec3& vAngle, int iMethod = Vars::Aimbot::General::AimType.Value);
void Aim(CUserCmd* pCmd, Vec3& vAngles, int iMethod = Vars::Aimbot::General::AimType.Value);
bool ShouldFire(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, CUserCmd* pCmd, const Target_t& tTarget);
Vec3 m_vEyePos = {};
@@ -30,12 +30,12 @@ static inline std::vector<Target_t> GetTargets(CTFPlayer* pLocal, CTFWeaponBase*
if (Vars::Aimbot::General::Target.Value & Vars::Aimbot::General::TargetEnum::Players)
{
auto eGroupType = !F::AimbotGlobal.FriendlyFire() || Vars::Aimbot::General::Ignore.Value & Vars::Aimbot::General::IgnoreEnum::Team ? EntityEnum::PlayerEnemy : EntityEnum::PlayerAll;
auto eGroup = !F::AimbotGlobal.FriendlyFire() || Vars::Aimbot::General::Ignore.Value & Vars::Aimbot::General::IgnoreEnum::Team ? EntityEnum::PlayerEnemy : EntityEnum::PlayerAll;
if (Vars::Aimbot::Melee::WhipTeam.Value &&
!F::AimbotGlobal.FriendlyFire() && SDK::AttribHookValue(0, "speed_buff_ally", pWeapon) > 0)
eGroupType = EntityEnum::PlayerAll;
eGroup = EntityEnum::PlayerAll;
for (auto pEntity : H::Entities.GetGroup(eGroupType))
for (auto pEntity : H::Entities.GetGroup(eGroup))
{
if (F::AimbotGlobal.ShouldIgnore(pEntity, pLocal, pWeapon))
continue;
@@ -54,13 +54,13 @@ static inline std::vector<Target_t> GetTargets(CTFPlayer* pLocal, CTFWeaponBase*
}
{
auto eGroupType = EntityEnum::Invalid;
auto eGroup = EntityEnum::Invalid;
if (Vars::Aimbot::General::Target.Value & Vars::Aimbot::General::TargetEnum::Building)
eGroupType = EntityEnum::BuildingEnemy;
eGroup = EntityEnum::BuildingEnemy;
bool bWrench = pWeapon->GetWeaponID() == TF_WEAPON_WRENCH, bSapper = SDK::AttribHookValue(0, "set_dmg_apply_to_sapper", pWeapon);
if (Vars::Aimbot::Healing::AutoRepair.Value && (bWrench || bSapper))
eGroupType = eGroupType != EntityEnum::Invalid ? EntityEnum::BuildingAll : EntityEnum::BuildingTeam;
for (auto pEntity : H::Entities.GetGroup(eGroupType))
eGroup = eGroup != EntityEnum::Invalid ? EntityEnum::BuildingAll : EntityEnum::BuildingTeam;
for (auto pEntity : H::Entities.GetGroup(eGroup))
{
if (F::AimbotGlobal.ShouldIgnore(pEntity, pLocal, pWeapon))
continue;
@@ -369,6 +369,7 @@ int CAimbotMelee::CanHit(Target_t& tTarget, CTFPlayer* pLocal, CTFWeaponBase* pW
tTarget.m_pEntity->m_vecMins() = pRecord->m_vMins + PLAYER_ORIGIN_COMPRESSION;
tTarget.m_pEntity->m_vecMaxs() = pRecord->m_vMaxs - PLAYER_ORIGIN_COMPRESSION;
// possibly account melee bounds as well?
tTarget.m_vPos = m_vEyePos.Clamp(pRecord->m_vOrigin + tTarget.m_pEntity->m_vecMins(), pRecord->m_vOrigin + tTarget.m_pEntity->m_vecMaxs());
if (Vars::Aimbot::Melee::AutoBackstab.Value && pWeapon->GetWeaponID() == TF_WEAPON_KNIFE)
tTarget.m_vPos.x = pRecord->m_vOrigin.x, tTarget.m_vPos.y = pRecord->m_vOrigin.y;
@@ -459,7 +460,7 @@ bool CAimbotMelee::Aim(Vec3 vCurAngle, Vec3 vToAngle, Vec3& vOut, int iMethod)
}
// assume angle calculated outside with other overload
void CAimbotMelee::Aim(CUserCmd* pCmd, Vec3& vAngle, int iMethod)
void CAimbotMelee::Aim(CUserCmd* pCmd, Vec3& vAngles, int iMethod)
{
bool bUnsure = F::Ticks.IsTimingUnsure();
switch (iMethod)
@@ -470,20 +471,20 @@ void CAimbotMelee::Aim(CUserCmd* pCmd, Vec3& vAngle, int iMethod)
[[fallthrough]];
case Vars::Aimbot::General::AimTypeEnum::Smooth:
case Vars::Aimbot::General::AimTypeEnum::Assistive:
pCmd->viewangles = vAngle;
I::EngineClient->SetViewAngles(vAngle);
pCmd->viewangles = vAngles;
I::EngineClient->SetViewAngles(vAngles);
break;
case Vars::Aimbot::General::AimTypeEnum::Silent:
if (G::Attacking == 1 || bUnsure)
{
SDK::FixMovement(pCmd, vAngle);
pCmd->viewangles = vAngle;
SDK::FixMovement(pCmd, vAngles);
pCmd->viewangles = vAngles;
G::PSilentAngles = true;
}
break;
case Vars::Aimbot::General::AimTypeEnum::Locking:
SDK::FixMovement(pCmd, vAngle);
pCmd->viewangles = vAngle;
SDK::FixMovement(pCmd, vAngles);
pCmd->viewangles = vAngles;
G::SilentAngles = true;
}
}
@@ -12,7 +12,7 @@ private:
int CanHit(Target_t& tTarget, CTFPlayer* pLocal, CTFWeaponBase* pWeapon);
bool Aim(Vec3 vCurAngle, Vec3 vToAngle, Vec3& vOut, int iMethod = Vars::Aimbot::General::AimType.Value);
void Aim(CUserCmd* pCmd, Vec3& vAngle, int iMethod = Vars::Aimbot::General::AimType.Value);
void Aim(CUserCmd* pCmd, Vec3& vAngles, int iMethod = Vars::Aimbot::General::AimType.Value);
bool FindNearestBuildPoint(CBaseObject* pBuilding, CTFPlayer* pLocal, Vec3& vPoint);
bool RunSapper(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, CUserCmd* pCmd);
File diff suppressed because it is too large Load Diff
@@ -5,9 +5,9 @@
#include "../../Simulation/MovementSimulation/MovementSimulation.h"
#include "../../Simulation/ProjectileSimulation/ProjectileSimulation.h"
Enum(PointFlags, None = 0, Regular = 1 << 0, Alternate = 1 << 1)
Enum(PointFlags, None = 0, Regular = 1 << 0, Lob = 1 << 1)
Enum(PointType, Direct, Geometry, Air)
Enum(CalculateFlags, None = 0, TwoPass = 1 << 0, SetupClip = 1 << 1, AccountDrag = 1 << 2, AlternateAngle = 1 << 3, Accuracy = TwoPass | SetupClip | AccountDrag)
Enum(CalculateFlags, None = 0, TwoPass = 1 << 0, SetupClip = 1 << 1, AccountDrag = 1 << 2, LobAngle = 1 << 3, Accuracy = TwoPass | SetupClip | AccountDrag)
Enum(CalculateResult, Pending, Good, Time, Bad)
struct Info_t
@@ -28,11 +28,12 @@ struct Info_t
float m_flGravity = 0.f;
float m_flRadius = 0.f;
float m_flRadiusTime = 0.f;
float m_flBoundingTime = 0.f;
float m_flBoundsTime = 0.f;
float m_flOffsetTime = 0.f;
int m_iSplashCount = 0;
int m_iSplashRestrict = 0;
int m_iArmTime = 0;
float m_flNormalOffset = 0.f;
bool m_bIgnoreTiming = false;
};
#pragma pack(1)
@@ -41,30 +42,29 @@ struct Solution_t
float m_flPitch = 0.f;
float m_flYaw = 0.f;
float m_flTime = 0.f;
byte m_iCalculated = CalculateResultEnum::Pending;
uint8_t m_iCalculated = CalculateResultEnum::Pending;
};
#pragma pack()
struct Setup_t
{
Vec3 m_vPoint = {};
byte m_iType = PointTypeEnum::Geometry;
uint8_t m_iType = PointTypeEnum::Geometry;
};
struct Point_t
{
Vec3 m_vPoint = {};
Solution_t m_tSolution = {};
byte m_iType = PointTypeEnum::Direct;
uint8_t m_iType = PointTypeEnum::Direct;
};
struct Offset_t
{
Vec3 m_vOffset;
byte m_iType;
byte m_iFlags;
uint8_t m_iFlags;
};
using Directs_t = std::unordered_map<byte, Offset_t>;
using Splashes_t = std::vector<byte>;
using Directs_t = std::unordered_map<uint8_t, Offset_t>;
using Splashes_t = std::vector<uint8_t>;
struct History_t
{
@@ -83,21 +83,21 @@ struct Splash_t : History_t
{
float m_flTimeTo;
};
using DirectHistory_t = std::unordered_map<byte, std::vector<Direct_t>>;
using SplashHistory_t = std::unordered_map<byte, std::vector<Splash_t>>;
using DirectHistory_t = std::unordered_map<uint8_t, std::vector<Direct_t>>;
using SplashHistory_t = std::unordered_map<uint8_t, std::vector<Splash_t>>;
class CAimbotProjectile
{
private:
Directs_t GetDirects();
Splashes_t GetSplashes();
void SetupSplashPoints(Vec3& vOrigin, std::vector<Setup_t>& vSplashPoints, byte iFlags = CalculateFlagsEnum::None);
std::vector<Point_t> GetSplashPoints(Vec3 vOrigin, std::vector<Setup_t>& vSplashPoints, int iSimTime, byte iFlags = CalculateFlagsEnum::Accuracy);
void SetupSplashPoints(Vec3& vOrigin, std::vector<Setup_t>& vSplashPoints, uint8_t iFlags = CalculateFlagsEnum::None);
std::vector<Point_t> GetSplashPoints(Vec3 vOrigin, std::vector<Setup_t>& vSplashPoints, int iSimTime, uint8_t iFlags = CalculateFlagsEnum::Accuracy, bool bFirst = false);
void CalculateAngle(const Vec3& vLocalPos, const Vec3& vTargetPos, int iSimTime, Solution_t& tOut, byte iFlags = CalculateFlagsEnum::Accuracy, int iTolerance = -1);
bool TestAngle(const Vec3& vPoint, const Vec3& vAngles, int iSimTime, byte iType, bool bSecondTest = false);
void CalculateAngle(const Vec3& vLocalPos, const Vec3& vTargetPos, int iSimTime, Solution_t& tOut, uint8_t iFlags = CalculateFlagsEnum::Accuracy, int iTolerance = -1);
bool TestAngle(const Vec3& vPoint, const Vec3& vAngles, int iSimTime, uint8_t iType, uint8_t iFlags, bool bSecondTest = false);
bool HandlePoint(const Vec3& vOrigin, int iSimTime, float flPitch, float flYaw, float flTime, const Vec3& vPoint, byte iType = PointTypeEnum::Direct);
bool HandlePoint(const Vec3& vOrigin, int iSimTime, float flPitch, float flYaw, float flTime, const Vec3& vPoint, uint8_t iType = PointTypeEnum::Direct, uint8_t iFlags = PointFlagsEnum::Regular);
bool HandleDirect(DirectHistory_t& vDirectHistory);
bool HandleSplash(SplashHistory_t& vSplashHistory);
@@ -105,10 +105,10 @@ private:
bool RunMain(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, CUserCmd* pCmd);
bool CanHit(Target_t& tTarget, CTFPlayer* pLocal, CTFWeaponBase* pWeapon, CBaseEntity* pProjectile);
bool TestAngle(CBaseEntity* pProjectile, const Vec3& vPoint, Vec3& vAngles, int iSimTime, byte iType);
bool TestAngle(CBaseEntity* pProjectile, const Vec3& vPoint, Vec3& vAngles, int iSimTime, uint8_t iType, uint8_t iFlags);
bool Aim(const Vec3& vCurAngle, const Vec3& vToAngle, Vec3& vOut, int iMethod = Vars::Aimbot::General::AimType.Value);
void Aim(CUserCmd* pCmd, Vec3& vAngle, int iMethod = Vars::Aimbot::General::AimType.Value);
void Aim(CUserCmd* pCmd, Vec3& vAngles, int iMethod = Vars::Aimbot::General::AimType.Value);
Info_t m_tInfo = {};
MoveStorage m_tMoveStorage = {};
@@ -82,14 +82,14 @@ void CAutoAirblast::Run(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, CUserCmd* pCm
pProjectile->SetAbsOrigin(vOrigin);
if (Vars::Aimbot::Projectile::AutoAirblast.Value & Vars::Aimbot::Projectile::AutoAirblastEnum::Redirect)
{
Vec3 vAngle = Math::CalcAngle(vEyePos, vOrigin);
if (CanAirblastEntity(pLocal, pWeapon, pProjectile, vAngle))
Vec3 vAngles = Math::CalcAngle(vEyePos, vOrigin);
if (CanAirblastEntity(pLocal, pWeapon, pProjectile, vAngles))
{
bShouldBlast = true;
if (!F::AimbotProjectile.AutoAirblast(pLocal, pWeapon, pCmd, pProjectile))
{
SDK::FixMovement(pCmd, vAngle);
pCmd->viewangles = vAngle;
SDK::FixMovement(pCmd, vAngles);
pCmd->viewangles = vAngles;
G::PSilentAngles = true;
}
}
@@ -26,9 +26,9 @@ void CAutoDetonate::RestorePlayers()
m_mRestore.clear();
}
bool CAutoDetonate::GetRadius(EntityEnum::EntityEnum iGroup, CBaseEntity* pProjectile, float& flRadius, CTFWeaponBase*& pWeapon)
bool CAutoDetonate::GetRadius(EntityEnum::EntityEnum eGroup, CBaseEntity* pProjectile, float& flRadius, CTFWeaponBase*& pWeapon)
{
if (iGroup == EntityEnum::LocalStickies)
if (eGroup == EntityEnum::LocalStickies)
pWeapon = pProjectile->As<CTFGrenadePipebombProjectile>()->m_hOriginalLauncher()->As<CTFWeaponBase>();
else
pWeapon = pProjectile->As<CTFProjectile_Flare>()->m_hLauncher()->As<CTFWeaponBase>();
@@ -39,7 +39,7 @@ bool CAutoDetonate::GetRadius(EntityEnum::EntityEnum iGroup, CBaseEntity* pProje
return false;
}
if (iGroup == EntityEnum::LocalStickies)
if (eGroup == EntityEnum::LocalStickies)
{
auto pPipebomb = pProjectile->As<CTFGrenadePipebombProjectile>();
if (!pPipebomb->m_flCreationTime() || I::GlobalVars->curtime < pPipebomb->m_flCreationTime() + SDK::AttribHookValue(0.8f, "sticky_arm_time", pWeapon))
@@ -63,11 +63,11 @@ bool CAutoDetonate::GetRadius(EntityEnum::EntityEnum iGroup, CBaseEntity* pProje
return true;
}
Vec3 CAutoDetonate::GetOrigin(CBaseEntity* pProjectile, EntityEnum::EntityEnum iGroup, float flLatency)
Vec3 CAutoDetonate::GetOrigin(CBaseEntity* pProjectile, EntityEnum::EntityEnum eGroup, float flLatency)
{
Vec3 vOrigin = SDK::PredictOrigin(pProjectile->m_vecOrigin(), pProjectile->GetAbsVelocity(), flLatency);
if (iGroup == EntityEnum::LocalStickies)
if (eGroup == EntityEnum::LocalStickies)
{ // why is this even a thing?
CGameTrace trace = {};
CTraceFilterWorldAndPropsOnly filter = {};
@@ -128,9 +128,9 @@ bool CAutoDetonate::CheckEntities(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, CUs
return false;
}
bool CAutoDetonate::CheckTargets(CTFPlayer* pLocal, EntityEnum::EntityEnum iGroup, float flRadiusScale, CUserCmd* pCmd)
bool CAutoDetonate::CheckTargets(CTFPlayer* pLocal, EntityEnum::EntityEnum eGroup, float flRadiusScale, CUserCmd* pCmd)
{
auto& vProjectiles = H::Entities.GetGroup(iGroup);
auto& vProjectiles = H::Entities.GetGroup(eGroup);
if (vProjectiles.empty())
return false;
@@ -139,13 +139,13 @@ bool CAutoDetonate::CheckTargets(CTFPlayer* pLocal, EntityEnum::EntityEnum iGrou
{
float flRadius = flRadiusScale;
CTFWeaponBase* pWeapon = nullptr;
if (!GetRadius(iGroup, pProjectile, flRadius, pWeapon))
if (!GetRadius(eGroup, pProjectile, flRadius, pWeapon))
continue;
PredictPlayers(pLocal, flLatency);
bool bCheck = CheckEntities(pLocal, pWeapon, nullptr, pProjectile, flRadius, GetOrigin(pProjectile, iGroup, flLatency));
bool bCheck = CheckEntities(pLocal, pWeapon, nullptr, pProjectile, flRadius, GetOrigin(pProjectile, eGroup, flLatency));
PredictPlayers(pLocal, 0.f);
bCheck &= CheckEntities(pLocal, pWeapon, pCmd, pProjectile, flRadius, GetOrigin(pProjectile, iGroup));
bCheck &= CheckEntities(pLocal, pWeapon, pCmd, pProjectile, flRadius, GetOrigin(pProjectile, eGroup));
RestorePlayers();
if (bCheck)
return true;
@@ -154,12 +154,12 @@ bool CAutoDetonate::CheckTargets(CTFPlayer* pLocal, EntityEnum::EntityEnum iGrou
return false;
}
bool CAutoDetonate::CheckSelf(CTFPlayer* pLocal, EntityEnum::EntityEnum iGroup)
bool CAutoDetonate::CheckSelf(CTFPlayer* pLocal, EntityEnum::EntityEnum eGroup)
{
if (!(Vars::Aimbot::Projectile::AutoDetonate.Value & Vars::Aimbot::Projectile::AutoDetonateEnum::PreventSelfDamage) || !pLocal->IsAlive() || pLocal->IsAGhost() || pLocal->IsInvulnerable())
return false;
auto& vProjectiles = H::Entities.GetGroup(iGroup);
auto& vProjectiles = H::Entities.GetGroup(eGroup);
if (vProjectiles.empty())
return false;
@@ -169,12 +169,12 @@ bool CAutoDetonate::CheckSelf(CTFPlayer* pLocal, EntityEnum::EntityEnum iGroup)
{
float flRadius = 1.f;
CTFWeaponBase* pWeapon = nullptr;
if (!GetRadius(iGroup, pProjectile, flRadius, pWeapon))
if (!GetRadius(eGroup, pProjectile, flRadius, pWeapon))
continue;
PredictPlayers(pLocal, 0.f, true);
bool bCheck = CheckEntity(pLocal, pLocal, pWeapon, nullptr, pProjectile, flRadius, GetOrigin(pProjectile, iGroup, flLatency))
&& CheckEntity(pLocal, pLocal, pWeapon, nullptr, pProjectile, flRadius, GetOrigin(pProjectile, iGroup));
bool bCheck = CheckEntity(pLocal, pLocal, pWeapon, nullptr, pProjectile, flRadius, GetOrigin(pProjectile, eGroup, flLatency))
&& CheckEntity(pLocal, pLocal, pWeapon, nullptr, pProjectile, flRadius, GetOrigin(pProjectile, eGroup));
RestorePlayers();
if (bCheck)
return true;
@@ -183,13 +183,13 @@ bool CAutoDetonate::CheckSelf(CTFPlayer* pLocal, EntityEnum::EntityEnum iGroup)
return false;
}
bool CAutoDetonate::Check(CTFPlayer* pLocal, CUserCmd* pCmd, EntityEnum::EntityEnum iGroup, int iFlag)
bool CAutoDetonate::Check(CTFPlayer* pLocal, CUserCmd* pCmd, EntityEnum::EntityEnum eGroup, int iFlag)
{
if (!(Vars::Aimbot::Projectile::AutoDetonate.Value & iFlag))
return false;
return CheckTargets(pLocal, iGroup, Vars::Aimbot::Projectile::AutodetRadius.Value / 100, pCmd)
&& !CheckSelf(pLocal, iGroup);
return CheckTargets(pLocal, eGroup, Vars::Aimbot::Projectile::AutodetRadius.Value / 100, pCmd)
&& !CheckSelf(pLocal, eGroup);
}
void CAutoDetonate::Run(CTFPlayer* pLocal, CUserCmd* pCmd)
@@ -9,12 +9,12 @@ class CAutoDetonate
private:
bool CheckEntity(CBaseEntity* pEntity, CTFPlayer* pLocal, CTFWeaponBase* pWeapon, CUserCmd* pCmd, CBaseEntity* pProjectile, float flRadius, Vec3 vOrigin);
bool CheckEntities(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, CUserCmd* pCmd, CBaseEntity* pProjectile, float flRadius, Vec3 vOrigin);
bool CheckTargets(CTFPlayer* pLocal, EntityEnum::EntityEnum iGroup, float flRadiusScale, CUserCmd* pCmd);
bool CheckSelf(CTFPlayer* pLocal, EntityEnum::EntityEnum iGroup);
bool Check(CTFPlayer* pLocal, CUserCmd* pCmd, EntityEnum::EntityEnum iGroup, int iFlag);
bool CheckTargets(CTFPlayer* pLocal, EntityEnum::EntityEnum eGroup, float flRadiusScale, CUserCmd* pCmd);
bool CheckSelf(CTFPlayer* pLocal, EntityEnum::EntityEnum eGroup);
bool Check(CTFPlayer* pLocal, CUserCmd* pCmd, EntityEnum::EntityEnum eGroup, int iFlag);
bool GetRadius(EntityEnum::EntityEnum iGroup, CBaseEntity* pProjectile, float& flRadius, CTFWeaponBase*& pWeapon);
Vec3 GetOrigin(CBaseEntity* pProjectile, EntityEnum::EntityEnum iGroup, float flLatency = 0.f);
bool GetRadius(EntityEnum::EntityEnum eGroup, CBaseEntity* pProjectile, float& flRadius, CTFWeaponBase*& pWeapon);
Vec3 GetOrigin(CBaseEntity* pProjectile, EntityEnum::EntityEnum eGroup, float flLatency = 0.f);
void PredictPlayers(CTFPlayer* pLocal, float flLatency = 0.f, bool bLocal = false);
void RestorePlayers();
@@ -146,22 +146,23 @@ void CAutoRocketJump::Run(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, CUserCmd* p
bool bMoveSimSetup = F::MoveSim.Initialize(pLocal, tMoveStorage, false); // do move sim after to not mess with proj sim
if (bMoveSimSetup && bProjSimSetup)
{
Vec3 vOriginal = F::ProjSim.GetOrigin();
int iSkip = bCurrGrounded ? Vars::Misc::Movement::AutoRocketJumpSkipGround.Value : Vars::Misc::Movement::AutoRocketJumpSkipAir.Value;
CGameTrace trace = {};
CTraceFilterCollideable filter = {};
filter.pSkip = pLocal;
Vec3 vNew = F::ProjSim.GetOrigin();
for (int n = 1; n < 10; n++)
{
F::MoveSim.RunTick(tMoveStorage);
if (n <= iSkip || n == 1 && G::Reloading)
continue;
Vec3 Old = F::ProjSim.GetOrigin();
F::ProjSim.RunTick(tProjInfo);
Vec3 New = F::ProjSim.GetOrigin();
CGameTrace trace = {};
CTraceFilterCollideable filter = {};
filter.pSkip = pLocal;
SDK::Trace(Old, New, MASK_SOLID, &filter, &trace);
Vec3 vOld = vNew; vNew = F::ProjSim.GetOrigin();
SDK::Trace(vOld, vNew, MASK_SOLID, &filter, &trace);
if (trace.DidHit())
{
if (!pLocal->IsOnGround() || pLocal->IsSwimming())
+13 -5
View File
@@ -303,9 +303,11 @@ void CMenu::MenuAimbot(int iTab)
Divider();
FSlider(Vars::Aimbot::Projectile::VelocityAverageCount, FSliderEnum::Left);
FSlider(Vars::Aimbot::Projectile::VerticalShift, FSliderEnum::Right);
FSlider(Vars::Aimbot::Projectile::DragOverride, FSliderEnum::Left);
FSlider(Vars::Aimbot::Projectile::TimeOverride, FSliderEnum::Right);
FToggle(Vars::Aimbot::Projectile::LobAnglesUnderpredict);
Divider();
FSlider(Vars::Aimbot::Projectile::HuntsmanLerp, FSliderEnum::Left);
FSlider(Vars::Aimbot::Projectile::HuntsmanLerpLow, FSliderEnum::Right);
FSlider(Vars::Aimbot::Projectile::HuntsmanAdd, FSliderEnum::Left);
@@ -318,8 +320,6 @@ void CMenu::MenuAimbot(int iTab)
FText("Splash");
Divider(H::Draw.Scale(8), H::Draw.Scale(-1));
FDropdown(Vars::Aimbot::Projectile::SplashMode);
FSlider(Vars::Aimbot::Projectile::SplashNormalSkip, FSliderEnum::Left);
FSlider(Vars::Aimbot::Projectile::SplashAirCount, FSliderEnum::Right, !Vars::Aimbot::Projectile::SplashAirCount[DEFAULT_BIND] ? "random" : "%i");
PushTransparent(Vars::Aimbot::Projectile::SplashMode.Value != Vars::Aimbot::Projectile::SplashModeEnum::Trace);
{
FSlider(Vars::Aimbot::Projectile::SplashPointsDirect, FSliderEnum::Left);
@@ -335,9 +335,17 @@ void CMenu::MenuAimbot(int iTab)
FSlider(Vars::Aimbot::Projectile::SplashSamplesCutoff);
}
PopTransparent();
FSlider(Vars::Aimbot::Projectile::SplashCountDirect, FSliderEnum::Left);
FSlider(Vars::Aimbot::Projectile::SplashCountArc, FSliderEnum::Right);
FSlider(Vars::Aimbot::Projectile::SplashAirCount, FSliderEnum::None, !Vars::Aimbot::Projectile::SplashAirCount[DEFAULT_BIND] ? "random" : "%i");
Divider();
FSlider(Vars::Aimbot::Projectile::SplashRestrictDirect);
FSlider(Vars::Aimbot::Projectile::SplashRestrictArc);
FSlider(Vars::Aimbot::Projectile::SplashRestrictFirst);
Divider();
FSlider(Vars::Aimbot::Projectile::DirectTraceInterval);
FSlider(Vars::Aimbot::Projectile::SplashTraceInterval);
FSlider(Vars::Aimbot::Projectile::LobTraceInterval);
Divider();
FText("Misc");
@@ -35,19 +35,19 @@ void CNoSpreadProjectile::Run(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, CUserCm
for (int i = 0; i < 6; ++i)
SDK::RandomFloat();
Vec3 vAngAdd = pWeapon->GetSpreadAngles() - pLocal->EyeAngles();
Vec3 vAngAdd = pLocal->EyeAngles() - pWeapon->GetSpreadAngles();
switch (pWeapon->GetWeaponID())
{
case TF_WEAPON_COMPOUND_BOW:
if (I::GlobalVars->curtime - pWeapon->As<CTFPipebombLauncher>()->m_flChargeBeginTime() > TF_ARROW_MAX_CHARGE_TIME)
{
vAngAdd.x += float(SDK::RandomInt()) / VALVE_RAND_MAX * 12.f - 6.f;
vAngAdd.y += float(SDK::RandomInt()) / VALVE_RAND_MAX * 12.f - 6.f;
vAngAdd.x -= float(SDK::RandomInt()) / VALVE_RAND_MAX * 12.f - 6.f;
vAngAdd.y -= float(SDK::RandomInt()) / VALVE_RAND_MAX * 12.f - 6.f;
}
break;
case TF_WEAPON_SYRINGEGUN_MEDIC:
vAngAdd.x += SDK::RandomFloat(-1.5f, 1.5f);
vAngAdd.y += SDK::RandomFloat(-1.5f, 1.5f);
vAngAdd.x -= SDK::RandomFloat(-1.5f, 1.5f);
vAngAdd.y -= SDK::RandomFloat(-1.5f, 1.5f);
break;
case TF_WEAPON_GRENADELAUNCHER:
case TF_WEAPON_CANNON:
@@ -64,15 +64,17 @@ void CNoSpreadProjectile::Run(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, CUserCm
Vec3 vForward, vRight, vUp; Math::AngleVectors(pCmd->viewangles, &vForward, &vRight, &vUp);
Vec3 vVelocity = vForward * flSpeed + vUp * 200.f;
Vec3 vNewVelocity = vVelocity + vUp * SDK::RandomFloat(-10.f, 10.f) + vRight * SDK::RandomFloat(-10.f, 10.f);
Vec3 vAdjusted = vVelocity + vUp * SDK::RandomFloat(-10.f, 10.f) + vRight * SDK::RandomFloat(-10.f, 10.f);
vAngAdd = Math::VectorAngles(vNewVelocity) - Math::VectorAngles(vVelocity);
vAngAdd -= Math::VectorAngles(vAdjusted) - Math::VectorAngles(vVelocity);
}
}
if (!vAngAdd.IsZero())
{
pCmd->viewangles -= vAngAdd;
Vec3 vAngles = pCmd->viewangles + vAngAdd;
SDK::FixMovement(pCmd, vAngles);
pCmd->viewangles = vAngles;
G::PSilentAngles = true;
}
}
@@ -3,8 +3,6 @@
#include "../../EnginePrediction/EnginePrediction.h"
#include <numeric>
static CUserCmd s_tDummyCmd = {};
void CMovementSimulation::Store(MoveStorage& tMoveStorage)
{
auto pMap = tMoveStorage.m_pPlayer->GetPredDescMap();
@@ -65,11 +63,11 @@ static inline void HandleMovement(CTFPlayer* pPlayer, MoveData* pLastRecord, Mov
if (pPlayer->InCond(TF_COND_SHIELD_CHARGE))
{
s_tDummyCmd.forwardmove = 450.f;
s_tDummyCmd.sidemove = 0.f;
SDK::FixMovement(&s_tDummyCmd, bLocal ? G::CurrentUserCmd->viewangles : pPlayer->GetEyeAngles(), {});
tCurRecord.m_vDirection.x = s_tDummyCmd.forwardmove;
tCurRecord.m_vDirection.y = -s_tDummyCmd.sidemove;
G::DummyCmd.forwardmove = 450.f;
G::DummyCmd.sidemove = 0.f;
SDK::FixMovement(&G::DummyCmd, bLocal ? G::CurrentUserCmd->viewangles : pPlayer->GetEyeAngles(), {});
tCurRecord.m_vDirection.x = G::DummyCmd.forwardmove;
tCurRecord.m_vDirection.y = -G::DummyCmd.sidemove;
return;
}
@@ -204,7 +202,7 @@ bool CMovementSimulation::Initialize(CBaseEntity* pEntity, MoveStorage& tMoveSto
// the hacks that make it work
I::MoveHelper->SetHost(pPlayer);
pPlayer->m_pCurrentCommand() = &s_tDummyCmd;
pPlayer->m_pCurrentCommand() = &G::DummyCmd;
if (auto pAvgVelocity = H::Entities.GetAvgVelocity(pPlayer->entindex()))
pPlayer->m_vecVelocity() = *pAvgVelocity; // only use average velocity here
@@ -323,13 +321,13 @@ bool CMovementSimulation::SetupMoveData(MoveStorage& tMoveStorage)
auto& tRecord = vRecords.front();
if (!tRecord.m_vDirection.IsZero())
{
s_tDummyCmd.forwardmove = tRecord.m_vDirection.x;
s_tDummyCmd.sidemove = -tRecord.m_vDirection.y;
s_tDummyCmd.upmove = tRecord.m_vDirection.z;
SDK::FixMovement(&s_tDummyCmd, {}, tMoveStorage.m_MoveData.m_vecViewAngles);
tMoveStorage.m_MoveData.m_flForwardMove = s_tDummyCmd.forwardmove;
tMoveStorage.m_MoveData.m_flSideMove = s_tDummyCmd.sidemove;
tMoveStorage.m_MoveData.m_flUpMove = s_tDummyCmd.upmove;
G::DummyCmd.forwardmove = tRecord.m_vDirection.x;
G::DummyCmd.sidemove = -tRecord.m_vDirection.y;
G::DummyCmd.upmove = tRecord.m_vDirection.z;
SDK::FixMovement(&G::DummyCmd, {}, tMoveStorage.m_MoveData.m_vecViewAngles);
tMoveStorage.m_MoveData.m_flForwardMove = G::DummyCmd.forwardmove;
tMoveStorage.m_MoveData.m_flSideMove = G::DummyCmd.sidemove;
tMoveStorage.m_MoveData.m_flUpMove = G::DummyCmd.upmove;
}
}
}
@@ -670,9 +668,9 @@ void CMovementSimulation::RunTick(MoveStorage& tMoveStorage, bool bPath, RunTick
&& tMoveStorage.m_MoveData.m_vecVelocity.Length2D() > tMoveStorage.m_MoveData.m_flMaxSpeed * 0.015f)
{
Vec3 vDirection = tMoveStorage.m_MoveData.m_vecVelocity.Normalized2D() * 450.f;
s_tDummyCmd.forwardmove = vDirection.x, s_tDummyCmd.sidemove = -vDirection.y;
SDK::FixMovement(&s_tDummyCmd, {}, tMoveStorage.m_MoveData.m_vecViewAngles);
tMoveStorage.m_MoveData.m_flForwardMove = s_tDummyCmd.forwardmove, tMoveStorage.m_MoveData.m_flSideMove = s_tDummyCmd.sidemove;
G::DummyCmd.forwardmove = vDirection.x, G::DummyCmd.sidemove = -vDirection.y;
SDK::FixMovement(&G::DummyCmd, {}, tMoveStorage.m_MoveData.m_vecViewAngles);
tMoveStorage.m_MoveData.m_flForwardMove = G::DummyCmd.forwardmove, tMoveStorage.m_MoveData.m_flSideMove = G::DummyCmd.sidemove;
}
RestoreBounds(tMoveStorage.m_pPlayer);
@@ -1,6 +1,7 @@
#include "ProjectileSimulation.h"
#include "../../EnginePrediction/EnginePrediction.h"
#include "../../NoSpread/NoSpreadProjectile/NoSpreadProjectile.h"
#include "../../CritHack/CritHack.h"
#include "../../Backtrack/Backtrack.h"
@@ -18,14 +19,30 @@ bool CProjectileSimulation::GetInfoMain(CTFPlayer* pPlayer, CTFWeaponBase* pWeap
bool bMaxSpeed = iFlags & ProjSimEnum::MaxSpeed;
bool bPredictCmdNum = iFlags & ProjSimEnum::PredictCmdNum;
bool bNoRandomAngles = iFlags & ProjSimEnum::NoRandomAngles;
bool bCorrectRandomAngles = iFlags & ProjSimEnum::CorrectRandomAngles;
Vec3 vPos, vAngle;
if (bCorrectRandomAngles)
{
int iOriginalAttacking = G::Attacking;
bool bOriginalSilent = G::PSilentAngles;
G::DummyCmd.viewangles = vAngles;
G::DummyCmd.command_number = bPredictCmdNum ? F::CritHack.PredictCmdNum(pPlayer, pWeapon, G::CurrentUserCmd) : G::CurrentUserCmd->command_number;
G::Attacking = 1;
F::NoSpreadProjectile.Run(pPlayer, pWeapon, &G::DummyCmd);
vAngles = G::DummyCmd.viewangles;
G::Attacking = iOriginalAttacking;
G::PSilentAngles = bOriginalSilent;
}
if (Vars::Visuals::Trajectory::Override.Value)
{
SDK::GetProjectileFireSetup(pPlayer, vAngles, { Vars::Visuals::Trajectory::OffsetX.Value, Vars::Visuals::Trajectory::OffsetY.Value, Vars::Visuals::Trajectory::OffsetZ.Value }, vPos, vAngle, bRedirect ? Vars::Visuals::Trajectory::ForwardRedirect.Value : 0.f, Vars::Visuals::Trajectory::ForwardCutoff.Value, bInterp);
auto uType = FNV1A::Hash32(Vars::Visuals::Trajectory::Type.Value.c_str());
auto uType = FNV1A::Hash32Const("custom"); //FNV1A::Hash32(Vars::Visuals::Trajectory::Type.Value.c_str());
tProjInfo = { pPlayer, pWeapon, uType, vPos, vAngle, { Vars::Visuals::Trajectory::Hull.Value, Vars::Visuals::Trajectory::Hull.Value, Vars::Visuals::Trajectory::Hull.Value }, Vars::Visuals::Trajectory::Speed.Value, Vars::Visuals::Trajectory::Gravity.Value, Vars::Visuals::Trajectory::LifeTime.Value };
return true;
}
@@ -612,6 +629,9 @@ bool CProjectileSimulation::Initialize(ProjectileInfo& tProjInfo, bool bSimulate
m_pEnv->ResetSimulationClock();
}
if (tProjInfo.m_uType == FNV1A::Hash32Const("custom"))
tProjInfo.m_uType = FNV1A::Hash32(Vars::Visuals::Trajectory::Type.Value.c_str());
RunTick(tProjInfo, false); // simulate an initial time because dumb
return true;
@@ -619,9 +639,6 @@ bool CProjectileSimulation::Initialize(ProjectileInfo& tProjInfo, bool bSimulate
void CProjectileSimulation::RunTick(ProjectileInfo& tProjInfo, bool bPath) // bug: per frame projectile trace can cause inconsistencies?
{
if (!m_pEnv)
return;
if (bPath)
tProjInfo.m_vPath.push_back(GetOrigin());
@@ -6,9 +6,10 @@ Enum(ProjSim,
Redirect = 1 << 0, // redirect and possibly trace when doing GetProjectileFireSetup
InitCheck = 1 << 1, // validate starting position
Interp = 1 << 2, // use interpolation
NoRandomAngles = 1 << 3, // don't do angle stuff for aimbot, nospread will pick that up
PredictCmdNum = 1 << 4, // use crithack to predict command number
MaxSpeed = 1 << 5 // default projectile speeds to their maximum
PredictCmdNum = 1 << 3, // use crithack to predict command number
MaxSpeed = 1 << 4, // default projectile speeds to their maximum
NoRandomAngles = 1 << 5, // don't do angle stuff for aimbot, nospread will pick that up
CorrectRandomAngles = 1 << 6 // or do, position matters
)
#define GRENADE_CHECK_INTERVAL 0.195f
+8 -6
View File
@@ -90,13 +90,14 @@ void CVisuals::ProjectileTrace(CTFPlayer* pPlayer, CTFWeaponBase* pWeapon, const
return;
int iTicks = TIME_TO_TICKS(std::min(tProjInfo.m_flLifetime, 10.f));
Vec3 vNew = F::ProjSim.GetOrigin();
for (int n = 1; n <= iTicks; n++)
{
Vec3 Old = F::ProjSim.GetOrigin();
F::ProjSim.RunTick(tProjInfo);
Vec3 New = F::ProjSim.GetOrigin();
SDK::TraceHull(Old, New, -tProjInfo.m_vHull, tProjInfo.m_vHull, nMask, &filter, &trace);
Vec3 vOld = vNew; vNew = F::ProjSim.GetOrigin();
SDK::TraceHull(vOld, vNew, -tProjInfo.m_vHull, tProjInfo.m_vHull, nMask, &filter, &trace);
F::ProjSim.SetupTrace(filter, nMask, pWeapon, n, bInterp);
if (trace.DidHit())
{
@@ -924,13 +925,14 @@ void CVisuals::Store()
F::ProjSim.SetupTrace(filter, nMask, pEntity);
int iTicks = TIME_TO_TICKS(std::min(tProjInfo.m_flLifetime, 10.f));
Vec3 vNew = F::ProjSim.GetOrigin();
for (int n = 1; n <= iTicks; n++)
{
Vec3 Old = F::ProjSim.GetOrigin();
F::ProjSim.RunTick(tProjInfo);
Vec3 New = F::ProjSim.GetOrigin();
SDK::TraceHull(Old, New, -tProjInfo.m_vHull, tProjInfo.m_vHull, nMask, &filter, &trace);
Vec3 vOld = vNew; vNew = F::ProjSim.GetOrigin();
SDK::TraceHull(vOld, vNew, -tProjInfo.m_vHull, tProjInfo.m_vHull, nMask, &filter, &trace);
if (trace.DidHit())
{
tProjectile.m_vNormal = trace.plane.normal;
+1 -1
View File
@@ -512,7 +512,7 @@ void CWorld::DrawFace(const Face_t& tFace, int iFlags)
const Vec3& vVertex1 = tFace.m_vVertices[i], &vVertex2 = tFace.m_vVertices[(i + 1) % tFace.m_vVertices.size()];
if (iFlags & DrawTypeEnum::Points)
G::BoxStorage.emplace_back(vVertex1, Vec3::Get(1), Vec3::Get(1), Vec3(0, 0, 0), I::GlobalVars->curtime + 60.f, Color_t(255, 0, 0), Color_t(0, 0, 0, 0), true);
G::BoxStorage.emplace_back(vVertex1, Vec3::Get(-1), Vec3::Get(1), Vec3(0, 0, 0), I::GlobalVars->curtime + 60.f, Color_t(255, 0, 0), Color_t(0, 0, 0, 0), true);
if (iFlags & DrawTypeEnum::Edges)
G::LineStorage.emplace_back(std::pair<Vec3, Vec3>(vVertex1, vVertex2), I::GlobalVars->curtime + 60.f, Color_t(255, 0, 0), true);
}
+44 -17
View File
@@ -197,6 +197,11 @@ public:
x = X; y = Y;
}
inline Vec2 Pow(float flPower) const
{
return Vec2(powf(x, flPower), powf(y, flPower));
}
inline float Min() const
{
return std::min<float>(x, y);
@@ -277,6 +282,23 @@ public:
return (x * x + y * y);
}
inline float Normalize()
{
float flLength = Length();
float flLengthNormal = 1.f / (FLT_EPSILON + flLength);
x *= flLengthNormal;
y *= flLengthNormal;
return flLength;
}
inline Vec2 Normalized() const
{
float flLengthNormal = 1.f / (FLT_EPSILON + Length());
return Vec2(x * flLengthNormal, y * flLengthNormal);
}
inline float DistTo(const Vec2& v) const
{
return (*this - v).Length();
@@ -502,6 +524,16 @@ public:
return { x, y };
}
inline Vec3 Get2D() const
{
return Vec3(x, y, 0);
}
inline Vec3 Pow(float flPower) const
{
return Vec3(powf(x, flPower), powf(y, flPower), powf(z, flPower));
}
inline float Min() const
{
return std::min<float>(x, std::min<float>(y, z));
@@ -582,6 +614,16 @@ public:
return (x * x + y * y + z * z);
}
inline float Length2D(void) const
{
return sqrtf(x * x + y * y);
}
inline float Length2DSqr(void) const
{
return (x * x + y * y);
}
inline float Normalize()
{
float flLength = Length();
@@ -606,33 +648,18 @@ public:
return flLength;
}
inline Vec3 Normalized()
inline Vec3 Normalized() const
{
float flLengthNormal = 1.f / (FLT_EPSILON + Length());
return Vec3(x * flLengthNormal, y * flLengthNormal, z * flLengthNormal);
}
inline Vec3 Normalized2D()
inline Vec3 Normalized2D() const
{
float flLengthNormal = 1.f / (FLT_EPSILON + Length2D());
return Vec3(x * flLengthNormal, y * flLengthNormal);
}
inline Vec3 Get2D()
{
return Vec3(x, y, 0);
}
inline float Length2D(void) const
{
return sqrtf(x * x + y * y);
}
inline float Length2DSqr(void) const
{
return (x * x + y * y);
}
inline float DistTo(const Vec3& v) const
{
return (*this - v).Length();
+1
View File
@@ -98,6 +98,7 @@ namespace G
inline CUserCmd* CurrentUserCmd = nullptr;
inline CUserCmd* LastUserCmd = nullptr;
inline CUserCmd OriginalCmd = {};
inline CUserCmd DummyCmd = {};
inline AimTarget_t AimTarget = {};
inline AimPoint_t AimPoint = {};
+2 -2
View File
@@ -3,13 +3,13 @@
#include "../../Definitions/Classes.h"
#include "../../Vars.h"
Enum(Entity, Invalid = -1,
Enum(Entity,
PlayerAll, PlayerEnemy, PlayerTeam,
BuildingAll, BuildingEnemy, BuildingTeam,
PickupHealth, PickupAmmo, PickupMoney, PickupPowerup, PickupSpellbook, PickupGargoyle,
WorldProjectile, WorldObjective, WorldNPC, WorldBomb,
LocalStickies, LocalFlares, SniperDots,
GroupsMax
Invalid, GroupsMax
)
struct DormantData
+8 -11
View File
@@ -3,7 +3,6 @@
#include "../Features/Visuals/Notifications/Notifications.h"
#include "../Features/ImGui/Menu/Menu.h"
#include "../Features/EnginePrediction/EnginePrediction.h"
#include <random>
#pragma warning (disable : 6385)
@@ -156,23 +155,15 @@ bool SDK::IsGameWindowInFocus()
return hWindow == GetForegroundWindow() || !hWindow;
}
double SDK::PlatFloatTime()
{
static auto Plat_FloatTime = U::Memory.GetModuleExport<double(*)()>("tier0.dll", "Plat_FloatTime");
return Plat_FloatTime();
}
static std::random_device s_tRandomDevice;
static std::mt19937 s_tEngine(s_tRandomDevice());
int SDK::StdRandomInt(int iMin, int iMax)
{
std::uniform_int_distribution<int> iDistribution(iMin, iMax);
return iDistribution(s_tEngine);
return iDistribution(Random);
}
float SDK::StdRandomFloat(float flMin, float flMax)
{
std::uniform_real_distribution<float> flDistribution(flMin, flMax);
return flDistribution(s_tEngine);
return flDistribution(Random);
}
int SDK::SeedFileLineHash(int iSeed, const char* sName, int iAdditionalSeed)
@@ -208,6 +199,12 @@ float SDK::RandomFloat(float flMinVal, float flMaxVal)
return RandomFloat(flMinVal, flMaxVal);
}
double SDK::PlatFloatTime()
{
static auto Plat_FloatTime = U::Memory.GetModuleExport<double(*)()>("tier0.dll", "Plat_FloatTime");
return Plat_FloatTime();
}
bool SDK::W2S(const Vec3& vOrigin, Vec3& vScreen, bool bAlways)
{
const auto& worldToScreen = H::Draw.m_mWorldToProjection.As3x4();
+3 -1
View File
@@ -20,6 +20,7 @@
#include "../Utils/Timer/Timer.h"
#include "../Utils/Macros/Macros.h"
#include <intrin.h>
#include <random>
#define DEFAULT_COLOR Color_t(175, 150, 255, 255)
#define ALTERNATE_COLOR Color_t(175, 150, 255, 127)
@@ -86,7 +87,7 @@ namespace SDK
HWND GetTeamFortressWindow();
bool IsGameWindowInFocus();
double PlatFloatTime();
inline std::default_random_engine Random = {};
int StdRandomInt(int iMin = 0, int iMax = VALVE_RAND_MAX);
float StdRandomFloat(float flMin = 0.f, float flMax = 1.f);
@@ -95,6 +96,7 @@ namespace SDK
void RandomSeed(int iSeed);
int RandomInt(int iMinVal = 0, int iMaxVal = VALVE_RAND_MAX);
float RandomFloat(float flMinVal = 0.f, float flMaxVal = 1.f);
double PlatFloatTime();
bool W2S(const Vec3& vOrigin, Vec3& vScreen, bool bAlways = false);
bool IsOnScreen(CBaseEntity* pEntity, const matrix3x4& mTransform, float* pLeft = nullptr, float* pRight = nullptr, float* pTop = nullptr, float* pBottom = nullptr, bool bAll = false);
+7 -4
View File
@@ -350,6 +350,7 @@ NAMESPACE_BEGIN(Vars)
CVar(VerticalShift, "Vertical shift", 5.f, NOSAVE | DEBUGVAR | SLIDER_MIN | SLIDER_PRECISION, 0.f, 10.f, 0.5f);
CVar(DragOverride, "Drag override", 0.f, NOSAVE | DEBUGVAR | SLIDER_MIN | SLIDER_PRECISION, 0.f, 1.f, 0.01f);
CVar(TimeOverride, "Time override", 0.f, NOSAVE | DEBUGVAR | SLIDER_MIN | SLIDER_PRECISION, 0.f, 2.f, 0.01f);
CVar(LobAnglesUnderpredict, "Lob angles underpredict", true, NOSAVE | DEBUGVAR);
CVar(HuntsmanLerp, "Huntsman lerp", 50.f, NOSAVE | DEBUGVAR | SLIDER_CLAMP | SLIDER_PRECISION, 0.f, 100.f, 1.f, "%g%%");
CVar(HuntsmanLerpLow, "Huntsman lerp low", 100.f, NOSAVE | DEBUGVAR | SLIDER_CLAMP | SLIDER_PRECISION, 0.f, 100.f, 1.f, "%g%%");
CVar(HuntsmanAdd, "Huntsman add", 0.f, NOSAVE | DEBUGVAR | SLIDER_CLAMP | SLIDER_PRECISION, 0.f, 20.f);
@@ -361,7 +362,6 @@ NAMESPACE_BEGIN(Vars)
CVarEnum(SplashMode, "Splash mode", 0, NOSAVE | DEBUGVAR, nullptr,
VA_LIST("Trace", "Face"),
Trace, Face);
CVar(SplashNormalSkip, "Splash normal skip", 1, NOSAVE | DEBUGVAR | SLIDER_MIN, 1, 10);
CVar(SplashAirCount, "Splash air count", 0, NOSAVE | DEBUGVAR | SLIDER_MIN, 0, 10);
CVar(SplashPointsDirect, "Splash points direct", 100, NOSAVE | DEBUGVAR | SLIDER_MIN | SLIDER_PRECISION, 0, 400, 5);
CVar(SplashPointsArc, "Splash points arc", 100, NOSAVE | DEBUGVAR | SLIDER_MIN | SLIDER_PRECISION, 0, 400, 5);
@@ -370,9 +370,12 @@ NAMESPACE_BEGIN(Vars)
CVar(SplashDensityDirect, "Splash density direct", 40.f, NOSAVE | DEBUGVAR | SLIDER_MIN | SLIDER_PRECISION, 0.f, 100.f, 1.f);
CVar(SplashDensityArc, "Splash density arc", 40.f, NOSAVE | DEBUGVAR | SLIDER_MIN | SLIDER_PRECISION, 0.f, 100.f, 1.f);
CVar(SplashSamplesCutoff, "Splash samples cutoff", 0.0000001f, NOSAVE | DEBUGVAR | SLIDER_MIN | SLIDER_PRECISION, 0.f, 0.000001f, 0.00000001f);
CVar(SplashCountDirect, "Splash count direct", 100, NOSAVE | DEBUGVAR | SLIDER_MIN | SLIDER_PRECISION, 1, 400, 5);
CVar(SplashCountArc, "Splash count arc", 5, NOSAVE | DEBUGVAR | SLIDER_MIN | SLIDER_PRECISION, 1, 400, 5);
CVar(SplashTraceInterval, "Splash trace interval", 10, NOSAVE | DEBUGVAR, 1, 10);
CVar(SplashRestrictDirect, "Splash restrict direct", 100, NOSAVE | DEBUGVAR | SLIDER_MIN | SLIDER_PRECISION, 1, 400, 5);
CVar(SplashRestrictArc, "Splash restrict arc", 5, NOSAVE | DEBUGVAR | SLIDER_MIN | SLIDER_PRECISION, 1, 400, 5);
CVar(SplashRestrictFirst, "Splash restrict first", 25, NOSAVE | DEBUGVAR | SLIDER_MIN | SLIDER_PRECISION, 1, 400, 5);
CVar(DirectTraceInterval, "Direct trace interval", 1, NOSAVE | DEBUGVAR | SLIDER_MIN, 1, 20);
CVar(SplashTraceInterval, "Splash trace interval", 10, NOSAVE | DEBUGVAR | SLIDER_MIN, 1, 20);
CVar(LobTraceInterval, "Lob trace interval", 20, NOSAVE | DEBUGVAR | SLIDER_MIN, 1, 20);
CVar(DeltaCount, "Delta count", 5, NOSAVE | DEBUGVAR, 1, 5);
CVarEnum(DeltaMode, "Delta mode", 0, NOSAVE | DEBUGVAR, nullptr,
+2 -2
View File
@@ -7,9 +7,9 @@ struct InterfaceInit_t
void** m_pPtr;
const char* m_sDLL;
const char* m_sName;
int8_t m_nType; // 0: find interface, 1: get export, 2: sig scan
uint8_t m_nType; // 0: find interface, 1: get export, 2: sig scan
int8_t m_nOffset;
int8_t m_nDereferenceCount;
uint8_t m_nDereferenceCount;
bool m_bNullCheck;
InterfaceInit_t(void** pPtr, const char* sDLL, const char* sName, int8_t nType, int8_t nOffset = 0, int8_t nDereferenceCount = 0, bool bNullCheck = true);
+13 -22
View File
@@ -40,26 +40,16 @@ namespace Math
inline void VectorAngles(const Vec3& vForward, Vec3& vAngles)
{
float flYaw, flPitch;
if (vForward.y == 0 && vForward.x == 0)
if (vForward.x || vForward.y)
{
flYaw = 0;
flPitch = vForward.z > 0 ? 270 : 90;
vAngles.x = Rad2Deg(atan2f(-vForward.z, vForward.Length2D()));
vAngles.y = Rad2Deg(atan2f(vForward.y, vForward.x));
}
else
{
flYaw = Rad2Deg(atan2f(vForward.y, vForward.x));
if (flYaw < 0)
flYaw += 360;
flPitch = Rad2Deg(atan2f(-vForward.z, vForward.Length2D()));
if (flPitch < 0)
flPitch += 360;
vAngles.x = vForward.z > 0 ? 270 : 90;
vAngles.y = 0;
}
vAngles.x = flPitch;
vAngles.y = flYaw;
vAngles.z = 0;
}
@@ -72,7 +62,7 @@ namespace Math
inline void AngleVectors(const Vec3& vAngles, Vec3* pForward = nullptr, Vec3* pRight = nullptr, Vec3* pUp = nullptr)
{
float sp, sy, sr, cp, cy, cr;
float sp, sy, cp, cy;
SinCos(Deg2Rad(vAngles.x), sp, cp);
SinCos(Deg2Rad(vAngles.y), sy, cy);
@@ -85,19 +75,20 @@ namespace Math
if (pRight || pUp)
{
float sr, cr;
SinCos(Deg2Rad(vAngles.z), sr, cr);
if (pRight)
{
pRight->x = (-1 * sr * sp * cy + -1 * cr * -sy);
pRight->y = (-1 * sr * sp * sy + -1 * cr * cy);
pRight->x = -1 * sr * sp * cy + -1 * cr * -sy;
pRight->y = -1 * sr * sp * sy + -1 * cr * cy;
pRight->z = -1 * sr * cp;
}
if (pUp)
{
pUp->x = (cr * sp * cy + -sr * -sy);
pUp->y = (cr * sp * sy + -sr * cy);
pUp->x = cr * sp * cy + -sr * -sy;
pUp->y = cr * sp * sy + -sr * cy;
pUp->z = cr * cp;
}
}
@@ -106,7 +97,7 @@ namespace Math
inline Vec3 CalcAngle(const Vec3& vFrom, const Vec3& vTo, bool bClamp = true)
{
Vec3 vDelta = vFrom - vTo;
float flHyp = std::sqrtf((vDelta.x * vDelta.x) + (vDelta.y * vDelta.y));
float flHyp = std::sqrtf(vDelta.x * vDelta.x + vDelta.y * vDelta.y);
Vec3 vAngles = {
atanf(vDelta.z / flHyp) * RAD,
@@ -132,7 +123,7 @@ namespace Math
AngleVectors(vToAng, &vToForward);
float flResult = Rad2Deg(acos(vFromForward.Dot(vToForward)));
if (!isfinite(flResult) || isinf(flResult) || isnan(flResult))
if (!isfinite(flResult))
flResult = 0.f;
return flResult;