mirror of
https://github.com/rei-2/Amalgam
synced 2026-10-10 04:43:09 +08:00
change doubletap hold aim behavior
This commit is contained in:
@@ -350,9 +350,7 @@ bool CAimbotGlobal::ShouldAim()
|
|||||||
{
|
{
|
||||||
case Vars::Aimbot::General::AimTypeEnum::Plain:
|
case Vars::Aimbot::General::AimTypeEnum::Plain:
|
||||||
case Vars::Aimbot::General::AimTypeEnum::Silent:
|
case Vars::Aimbot::General::AimTypeEnum::Silent:
|
||||||
// for performance reasons, the F::Ticks.m_bDoubletap condition is not a great fix here
|
if (!G::CanPrimaryAttack && !G::Reloading && !F::Ticks.IsTimingUnsure())
|
||||||
// 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)
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -685,11 +685,11 @@ bool CAimbotHitscan::Aim(Vec3 vCurAngle, Vec3 vToAngle, Vec3& vOut, int iMethod)
|
|||||||
// assume angle calculated outside with other overload
|
// assume angle calculated outside with other overload
|
||||||
void CAimbotHitscan::Aim(CUserCmd* pCmd, Vec3& vAngle, int iMethod)
|
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)
|
switch (iMethod)
|
||||||
{
|
{
|
||||||
case Vars::Aimbot::General::AimTypeEnum::Plain:
|
case Vars::Aimbot::General::AimTypeEnum::Plain:
|
||||||
if (G::Attacking != 1 && !bDoubleTap)
|
if (G::Attacking != 1 && !bUnsure)
|
||||||
break;
|
break;
|
||||||
[[fallthrough]];
|
[[fallthrough]];
|
||||||
case Vars::Aimbot::General::AimTypeEnum::Smooth:
|
case Vars::Aimbot::General::AimTypeEnum::Smooth:
|
||||||
@@ -698,7 +698,7 @@ void CAimbotHitscan::Aim(CUserCmd* pCmd, Vec3& vAngle, int iMethod)
|
|||||||
I::EngineClient->SetViewAngles(vAngle);
|
I::EngineClient->SetViewAngles(vAngle);
|
||||||
break;
|
break;
|
||||||
case Vars::Aimbot::General::AimTypeEnum::Silent:
|
case Vars::Aimbot::General::AimTypeEnum::Silent:
|
||||||
if (G::Attacking == 1 || bDoubleTap)
|
if (G::Attacking == 1 || bUnsure)
|
||||||
{
|
{
|
||||||
SDK::FixMovement(pCmd, vAngle);
|
SDK::FixMovement(pCmd, vAngle);
|
||||||
pCmd->viewangles = vAngle;
|
pCmd->viewangles = vAngle;
|
||||||
@@ -708,6 +708,7 @@ void CAimbotHitscan::Aim(CUserCmd* pCmd, Vec3& vAngle, int iMethod)
|
|||||||
case Vars::Aimbot::General::AimTypeEnum::Locking:
|
case Vars::Aimbot::General::AimTypeEnum::Locking:
|
||||||
SDK::FixMovement(pCmd, vAngle);
|
SDK::FixMovement(pCmd, vAngle);
|
||||||
pCmd->viewangles = vAngle;
|
pCmd->viewangles = vAngle;
|
||||||
|
G::SilentAngles = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -468,11 +468,11 @@ bool CAimbotMelee::Aim(Vec3 vCurAngle, Vec3 vToAngle, Vec3& vOut, int iMethod)
|
|||||||
// assume angle calculated outside with other overload
|
// assume angle calculated outside with other overload
|
||||||
void CAimbotMelee::Aim(CUserCmd* pCmd, Vec3& vAngle, int iMethod)
|
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)
|
switch (iMethod)
|
||||||
{
|
{
|
||||||
case Vars::Aimbot::General::AimTypeEnum::Plain:
|
case Vars::Aimbot::General::AimTypeEnum::Plain:
|
||||||
if (G::Attacking != 1 && !bDoubleTap)
|
if (G::Attacking != 1 && !bUnsure)
|
||||||
break;
|
break;
|
||||||
[[fallthrough]];
|
[[fallthrough]];
|
||||||
case Vars::Aimbot::General::AimTypeEnum::Smooth:
|
case Vars::Aimbot::General::AimTypeEnum::Smooth:
|
||||||
@@ -481,7 +481,7 @@ void CAimbotMelee::Aim(CUserCmd* pCmd, Vec3& vAngle, int iMethod)
|
|||||||
I::EngineClient->SetViewAngles(vAngle);
|
I::EngineClient->SetViewAngles(vAngle);
|
||||||
break;
|
break;
|
||||||
case Vars::Aimbot::General::AimTypeEnum::Silent:
|
case Vars::Aimbot::General::AimTypeEnum::Silent:
|
||||||
if (G::Attacking == 1 || bDoubleTap)
|
if (G::Attacking == 1 || bUnsure)
|
||||||
{
|
{
|
||||||
SDK::FixMovement(pCmd, vAngle);
|
SDK::FixMovement(pCmd, vAngle);
|
||||||
pCmd->viewangles = vAngle;
|
pCmd->viewangles = vAngle;
|
||||||
@@ -491,6 +491,7 @@ void CAimbotMelee::Aim(CUserCmd* pCmd, Vec3& vAngle, int iMethod)
|
|||||||
case Vars::Aimbot::General::AimTypeEnum::Locking:
|
case Vars::Aimbot::General::AimTypeEnum::Locking:
|
||||||
SDK::FixMovement(pCmd, vAngle);
|
SDK::FixMovement(pCmd, vAngle);
|
||||||
pCmd->viewangles = vAngle;
|
pCmd->viewangles = vAngle;
|
||||||
|
G::SilentAngles = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1623,11 +1623,11 @@ bool CAimbotProjectile::Aim(Vec3 vCurAngle, Vec3 vToAngle, Vec3& vOut, int iMeth
|
|||||||
// assume angle calculated outside with other overload
|
// assume angle calculated outside with other overload
|
||||||
void CAimbotProjectile::Aim(CUserCmd* pCmd, Vec3& vAngle, int iMethod)
|
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)
|
switch (iMethod)
|
||||||
{
|
{
|
||||||
case Vars::Aimbot::General::AimTypeEnum::Plain:
|
case Vars::Aimbot::General::AimTypeEnum::Plain:
|
||||||
if (G::Attacking != 1 && !bDoubleTap)
|
if (G::Attacking != 1 && !bUnsure)
|
||||||
break;
|
break;
|
||||||
[[fallthrough]];
|
[[fallthrough]];
|
||||||
case Vars::Aimbot::General::AimTypeEnum::Smooth:
|
case Vars::Aimbot::General::AimTypeEnum::Smooth:
|
||||||
@@ -1637,7 +1637,7 @@ void CAimbotProjectile::Aim(CUserCmd* pCmd, Vec3& vAngle, int iMethod)
|
|||||||
break;
|
break;
|
||||||
case Vars::Aimbot::General::AimTypeEnum::Silent:
|
case Vars::Aimbot::General::AimTypeEnum::Silent:
|
||||||
if (auto pWeapon = H::Entities.GetWeapon();
|
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);
|
SDK::FixMovement(pCmd, vAngle);
|
||||||
pCmd->viewangles = vAngle;
|
pCmd->viewangles = vAngle;
|
||||||
@@ -1647,6 +1647,7 @@ void CAimbotProjectile::Aim(CUserCmd* pCmd, Vec3& vAngle, int iMethod)
|
|||||||
case Vars::Aimbot::General::AimTypeEnum::Locking:
|
case Vars::Aimbot::General::AimTypeEnum::Locking:
|
||||||
SDK::FixMovement(pCmd, vAngle);
|
SDK::FixMovement(pCmd, vAngle);
|
||||||
pCmd->viewangles = vAngle;
|
pCmd->viewangles = vAngle;
|
||||||
|
G::SilentAngles = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -219,7 +219,7 @@ void CTicks::Move(float accumulated_extra_samples, bool bFinalTick, CTFPlayer* p
|
|||||||
MoveFunc(accumulated_extra_samples, m_iShiftedTicks - 1 == m_iShiftedGoal);
|
MoveFunc(accumulated_extra_samples, m_iShiftedTicks - 1 == m_iShiftedGoal);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_bShifting = m_bAntiWarp = false;
|
m_bShifting = m_bAntiWarp = m_bTimingUnsure = false;
|
||||||
if (m_bWarp)
|
if (m_bWarp)
|
||||||
m_iDeficit = 0;
|
m_iDeficit = 0;
|
||||||
|
|
||||||
@@ -242,7 +242,7 @@ void CTicks::MoveManage(CTFPlayer* pLocal)
|
|||||||
Speedhack();
|
Speedhack();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CTicks::CreateMove(CTFPlayer* pLocal, CUserCmd* pCmd, bool* pSendPacket)
|
void CTicks::CreateMove(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, CUserCmd* pCmd, bool* pSendPacket)
|
||||||
{
|
{
|
||||||
Doubletap(pLocal, pCmd);
|
Doubletap(pLocal, pCmd);
|
||||||
AntiWarp(pLocal, pCmd);
|
AntiWarp(pLocal, pCmd);
|
||||||
@@ -250,6 +250,9 @@ void CTicks::CreateMove(CTFPlayer* pLocal, CUserCmd* pCmd, bool* pSendPacket)
|
|||||||
|
|
||||||
SaveShootPos(pLocal);
|
SaveShootPos(pLocal);
|
||||||
SaveShootAngle(pCmd, *pSendPacket);
|
SaveShootAngle(pCmd, *pSendPacket);
|
||||||
|
|
||||||
|
if (m_bDoubletap && m_iShiftedTicks == m_iShiftStart && pWeapon && pWeapon->IsInReload())
|
||||||
|
m_bTimingUnsure = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CTicks::ManagePacket(CUserCmd* pCmd, bool* pSendPacket)
|
void CTicks::ManagePacket(CUserCmd* pCmd, bool* pSendPacket)
|
||||||
@@ -388,6 +391,11 @@ Vec3* CTicks::GetShootAngle()
|
|||||||
return nullptr;
|
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)
|
void CTicks::Draw(CTFPlayer* pLocal)
|
||||||
{
|
{
|
||||||
if (!(Vars::Menu::Indicators.Value & Vars::Menu::IndicatorsEnum::Ticks) || !pLocal->IsAlive())
|
if (!(Vars::Menu::Indicators.Value & Vars::Menu::IndicatorsEnum::Ticks) || !pLocal->IsAlive())
|
||||||
|
|||||||
@@ -22,10 +22,11 @@ private:
|
|||||||
Vec3 m_vShootAngle = {};
|
Vec3 m_vShootAngle = {};
|
||||||
|
|
||||||
bool m_bPredictAntiwarp = false;
|
bool m_bPredictAntiwarp = false;
|
||||||
|
bool m_bTimingUnsure = false; // we aren't sure when we'll actually fire, hold aim
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void Move(float accumulated_extra_samples, bool bFinalTick, CTFPlayer* pLocal);
|
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 Draw(CTFPlayer* pLocal);
|
||||||
void Reset();
|
void Reset();
|
||||||
|
|
||||||
@@ -44,6 +45,7 @@ public:
|
|||||||
Vec3 GetShootPos();
|
Vec3 GetShootPos();
|
||||||
void SaveShootAngle(CUserCmd* pCmd, bool bSendPacket);
|
void SaveShootAngle(CUserCmd* pCmd, bool bSendPacket);
|
||||||
Vec3* GetShootAngle();
|
Vec3* GetShootAngle();
|
||||||
|
bool IsTimingUnsure();
|
||||||
|
|
||||||
bool m_bDoubletap = false;
|
bool m_bDoubletap = false;
|
||||||
bool m_bWarp = false;
|
bool m_bWarp = false;
|
||||||
|
|||||||
@@ -261,7 +261,7 @@ MAKE_HOOK(CHLClient_CreateMove, U::Memory.GetVirtual(I::Client, 21), void,
|
|||||||
F::Misc.RunPost(pLocal, pCmd, *pSendPacket);
|
F::Misc.RunPost(pLocal, pCmd, *pSendPacket);
|
||||||
F::PacketManip.Run(pLocal, pWeapon, pCmd, pSendPacket);
|
F::PacketManip.Run(pLocal, pWeapon, pCmd, pSendPacket);
|
||||||
F::Visuals.CreateMove(pLocal, pWeapon);
|
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::AntiAim.Run(pLocal, pWeapon, pCmd, *pSendPacket);
|
||||||
F::NoSpreadHitscan.AskForPlayerPerf();
|
F::NoSpreadHitscan.AskForPlayerPerf();
|
||||||
F::EnginePrediction.End(pLocal, pCmd);
|
F::EnginePrediction.End(pLocal, pCmd);
|
||||||
|
|||||||
Reference in New Issue
Block a user