diff --git a/Amalgam/src/Features/Aimbot/AimbotGlobal/AimbotGlobal.cpp b/Amalgam/src/Features/Aimbot/AimbotGlobal/AimbotGlobal.cpp index 0b169f80..62335d39 100644 --- a/Amalgam/src/Features/Aimbot/AimbotGlobal/AimbotGlobal.cpp +++ b/Amalgam/src/Features/Aimbot/AimbotGlobal/AimbotGlobal.cpp @@ -350,9 +350,7 @@ bool CAimbotGlobal::ShouldAim() { case Vars::Aimbot::General::AimTypeEnum::Plain: case Vars::Aimbot::General::AimTypeEnum::Silent: - // for performance reasons, the F::Ticks.m_bDoubletap condition is not a great fix here - // and actually properly predicting when shots will be fired should likely be done over this, but it's fine for now - if (!G::CanPrimaryAttack && !G::Reloading && !F::Ticks.m_bDoubletap && !F::Ticks.m_bSpeedhack) + if (!G::CanPrimaryAttack && !G::Reloading && !F::Ticks.IsTimingUnsure()) return false; } diff --git a/Amalgam/src/Features/Aimbot/AimbotHitscan/AimbotHitscan.cpp b/Amalgam/src/Features/Aimbot/AimbotHitscan/AimbotHitscan.cpp index 9848a8e2..90d67bcd 100644 --- a/Amalgam/src/Features/Aimbot/AimbotHitscan/AimbotHitscan.cpp +++ b/Amalgam/src/Features/Aimbot/AimbotHitscan/AimbotHitscan.cpp @@ -685,11 +685,11 @@ 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) { - bool bDoubleTap = F::Ticks.m_bDoubletap || F::Ticks.GetTicks(H::Entities.GetWeapon()) || F::Ticks.m_bSpeedhack; + bool bUnsure = F::Ticks.IsTimingUnsure() || F::Ticks.GetTicks(H::Entities.GetWeapon()); switch (iMethod) { case Vars::Aimbot::General::AimTypeEnum::Plain: - if (G::Attacking != 1 && !bDoubleTap) + if (G::Attacking != 1 && !bUnsure) break; [[fallthrough]]; case Vars::Aimbot::General::AimTypeEnum::Smooth: @@ -698,7 +698,7 @@ void CAimbotHitscan::Aim(CUserCmd* pCmd, Vec3& vAngle, int iMethod) I::EngineClient->SetViewAngles(vAngle); break; case Vars::Aimbot::General::AimTypeEnum::Silent: - if (G::Attacking == 1 || bDoubleTap) + if (G::Attacking == 1 || bUnsure) { SDK::FixMovement(pCmd, vAngle); pCmd->viewangles = vAngle; @@ -708,6 +708,7 @@ void CAimbotHitscan::Aim(CUserCmd* pCmd, Vec3& vAngle, int iMethod) case Vars::Aimbot::General::AimTypeEnum::Locking: SDK::FixMovement(pCmd, vAngle); pCmd->viewangles = vAngle; + G::SilentAngles = true; } } diff --git a/Amalgam/src/Features/Aimbot/AimbotMelee/AimbotMelee.cpp b/Amalgam/src/Features/Aimbot/AimbotMelee/AimbotMelee.cpp index 4407865f..433863d9 100644 --- a/Amalgam/src/Features/Aimbot/AimbotMelee/AimbotMelee.cpp +++ b/Amalgam/src/Features/Aimbot/AimbotMelee/AimbotMelee.cpp @@ -468,11 +468,11 @@ 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) { - bool bDoubleTap = F::Ticks.m_bDoubletap || F::Ticks.GetTicks(H::Entities.GetWeapon()) || F::Ticks.m_bSpeedhack; + bool bUnsure = F::Ticks.IsTimingUnsure() || F::Ticks.GetTicks(H::Entities.GetWeapon()); switch (iMethod) { case Vars::Aimbot::General::AimTypeEnum::Plain: - if (G::Attacking != 1 && !bDoubleTap) + if (G::Attacking != 1 && !bUnsure) break; [[fallthrough]]; case Vars::Aimbot::General::AimTypeEnum::Smooth: @@ -481,7 +481,7 @@ void CAimbotMelee::Aim(CUserCmd* pCmd, Vec3& vAngle, int iMethod) I::EngineClient->SetViewAngles(vAngle); break; case Vars::Aimbot::General::AimTypeEnum::Silent: - if (G::Attacking == 1 || bDoubleTap) + if (G::Attacking == 1 || bUnsure) { SDK::FixMovement(pCmd, vAngle); pCmd->viewangles = vAngle; @@ -491,6 +491,7 @@ void CAimbotMelee::Aim(CUserCmd* pCmd, Vec3& vAngle, int iMethod) case Vars::Aimbot::General::AimTypeEnum::Locking: SDK::FixMovement(pCmd, vAngle); pCmd->viewangles = vAngle; + G::SilentAngles = true; } } diff --git a/Amalgam/src/Features/Aimbot/AimbotProjectile/AimbotProjectile.cpp b/Amalgam/src/Features/Aimbot/AimbotProjectile/AimbotProjectile.cpp index f5125971..8fbcb1ca 100644 --- a/Amalgam/src/Features/Aimbot/AimbotProjectile/AimbotProjectile.cpp +++ b/Amalgam/src/Features/Aimbot/AimbotProjectile/AimbotProjectile.cpp @@ -1623,11 +1623,11 @@ bool CAimbotProjectile::Aim(Vec3 vCurAngle, Vec3 vToAngle, Vec3& vOut, int iMeth // assume angle calculated outside with other overload void CAimbotProjectile::Aim(CUserCmd* pCmd, Vec3& vAngle, int iMethod) { - bool bDoubleTap = F::Ticks.m_bDoubletap || F::Ticks.GetTicks(H::Entities.GetWeapon()) || F::Ticks.m_bSpeedhack; + bool bUnsure = F::Ticks.IsTimingUnsure() || F::Ticks.GetTicks(H::Entities.GetWeapon()); switch (iMethod) { case Vars::Aimbot::General::AimTypeEnum::Plain: - if (G::Attacking != 1 && !bDoubleTap) + if (G::Attacking != 1 && !bUnsure) break; [[fallthrough]]; case Vars::Aimbot::General::AimTypeEnum::Smooth: @@ -1637,7 +1637,7 @@ void CAimbotProjectile::Aim(CUserCmd* pCmd, Vec3& vAngle, int iMethod) break; case Vars::Aimbot::General::AimTypeEnum::Silent: if (auto pWeapon = H::Entities.GetWeapon(); - G::Attacking == 1 || bDoubleTap || pWeapon && pWeapon->GetWeaponID() == TF_WEAPON_FLAMETHROWER) + G::Attacking == 1 || bUnsure || pWeapon && pWeapon->GetWeaponID() == TF_WEAPON_FLAMETHROWER) { SDK::FixMovement(pCmd, vAngle); pCmd->viewangles = vAngle; @@ -1647,6 +1647,7 @@ void CAimbotProjectile::Aim(CUserCmd* pCmd, Vec3& vAngle, int iMethod) case Vars::Aimbot::General::AimTypeEnum::Locking: SDK::FixMovement(pCmd, vAngle); pCmd->viewangles = vAngle; + G::SilentAngles = true; } } diff --git a/Amalgam/src/Features/Ticks/Ticks.cpp b/Amalgam/src/Features/Ticks/Ticks.cpp index 78c935f1..1ddbbf3b 100644 --- a/Amalgam/src/Features/Ticks/Ticks.cpp +++ b/Amalgam/src/Features/Ticks/Ticks.cpp @@ -219,7 +219,7 @@ void CTicks::Move(float accumulated_extra_samples, bool bFinalTick, CTFPlayer* p MoveFunc(accumulated_extra_samples, m_iShiftedTicks - 1 == m_iShiftedGoal); } - m_bShifting = m_bAntiWarp = false; + m_bShifting = m_bAntiWarp = m_bTimingUnsure = false; if (m_bWarp) m_iDeficit = 0; @@ -242,7 +242,7 @@ void CTicks::MoveManage(CTFPlayer* pLocal) Speedhack(); } -void CTicks::CreateMove(CTFPlayer* pLocal, CUserCmd* pCmd, bool* pSendPacket) +void CTicks::CreateMove(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, CUserCmd* pCmd, bool* pSendPacket) { Doubletap(pLocal, pCmd); AntiWarp(pLocal, pCmd); @@ -250,6 +250,9 @@ void CTicks::CreateMove(CTFPlayer* pLocal, CUserCmd* pCmd, bool* pSendPacket) SaveShootPos(pLocal); SaveShootAngle(pCmd, *pSendPacket); + + if (m_bDoubletap && m_iShiftedTicks == m_iShiftStart && pWeapon && pWeapon->IsInReload()) + m_bTimingUnsure = true; } void CTicks::ManagePacket(CUserCmd* pCmd, bool* pSendPacket) @@ -388,6 +391,11 @@ Vec3* CTicks::GetShootAngle() return nullptr; } +bool CTicks::IsTimingUnsure() +{ // actually knowing when we'll shoot would be better than this, but this is fine for now + return m_bTimingUnsure || m_bSpeedhack /*|| m_bWarp*/; +} + void CTicks::Draw(CTFPlayer* pLocal) { if (!(Vars::Menu::Indicators.Value & Vars::Menu::IndicatorsEnum::Ticks) || !pLocal->IsAlive()) diff --git a/Amalgam/src/Features/Ticks/Ticks.h b/Amalgam/src/Features/Ticks/Ticks.h index cba099c5..fef96123 100644 --- a/Amalgam/src/Features/Ticks/Ticks.h +++ b/Amalgam/src/Features/Ticks/Ticks.h @@ -22,10 +22,11 @@ private: Vec3 m_vShootAngle = {}; bool m_bPredictAntiwarp = false; + bool m_bTimingUnsure = false; // we aren't sure when we'll actually fire, hold aim public: void Move(float accumulated_extra_samples, bool bFinalTick, CTFPlayer* pLocal); - void CreateMove(CTFPlayer* pLocal, CUserCmd* pCmd, bool* pSendPacket); + void CreateMove(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, CUserCmd* pCmd, bool* pSendPacket); void Draw(CTFPlayer* pLocal); void Reset(); @@ -44,6 +45,7 @@ public: Vec3 GetShootPos(); void SaveShootAngle(CUserCmd* pCmd, bool bSendPacket); Vec3* GetShootAngle(); + bool IsTimingUnsure(); bool m_bDoubletap = false; bool m_bWarp = false; diff --git a/Amalgam/src/Hooks/CHLClient_CreateMove.cpp b/Amalgam/src/Hooks/CHLClient_CreateMove.cpp index deb2bbce..f4632e8b 100644 --- a/Amalgam/src/Hooks/CHLClient_CreateMove.cpp +++ b/Amalgam/src/Hooks/CHLClient_CreateMove.cpp @@ -261,7 +261,7 @@ MAKE_HOOK(CHLClient_CreateMove, U::Memory.GetVirtual(I::Client, 21), void, F::Misc.RunPost(pLocal, pCmd, *pSendPacket); F::PacketManip.Run(pLocal, pWeapon, pCmd, pSendPacket); F::Visuals.CreateMove(pLocal, pWeapon); - F::Ticks.CreateMove(pLocal, pCmd, pSendPacket); + F::Ticks.CreateMove(pLocal, pWeapon, pCmd, pSendPacket); F::AntiAim.Run(pLocal, pWeapon, pCmd, *pSendPacket); F::NoSpreadHitscan.AskForPlayerPerf(); F::EnginePrediction.End(pLocal, pCmd);