mirror of
https://github.com/rei-2/Amalgam
synced 2026-10-10 04:43:09 +08:00
misc changes and fixes
This commit is contained in:
@@ -315,7 +315,7 @@ bool CAimbotMelee::CanBackstab(CBaseEntity* pTarget, CTFPlayer* pLocal, Vec3 vEy
|
||||
if (Vars::Aimbot::Melee::BackstabDoubleTest.Value && !TestDots(vTargetAngles))
|
||||
return false;
|
||||
|
||||
vTargetAngles.y += H::Entities.GetPingAngles(pTarget->entindex()).y;
|
||||
vTargetAngles.y += H::Entities.GetDeltaAngles(pTarget->entindex()).y;
|
||||
if (!TestDots(vTargetAngles))
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -485,8 +485,8 @@ static inline void TracePoint(Vec3& vPoint, int& iType, Vec3& vTargetEye, Info_t
|
||||
size_t iOriginalSize = vPoints.size();
|
||||
|
||||
{
|
||||
bool bCheckNormal = !bNormal && iOriginalType & PointTypeEnum::Regular;
|
||||
if (bNormal = bCheckNormal && (tInfo.m_vLocalEye - vTargetEye).Dot(vTargetEye - vPoint) > 0.f)
|
||||
// necessary performance wise?
|
||||
if (bNormal = (tInfo.m_vLocalEye - vTargetEye).Dot(vTargetEye - vPoint) > 0.f)
|
||||
goto breakOutExtra;
|
||||
|
||||
if (!(iOriginalType & PointTypeEnum::Regular)) // don't do the same trace over again
|
||||
|
||||
@@ -274,7 +274,7 @@ void CAutoHeal::GetDangers(CTFPlayer* pTarget, bool bVaccinator, float& flBullet
|
||||
|
||||
bool bCheater = F::PlayerUtils.HasTag(iIndex, F::PlayerUtils.TagToIndex(CHEATER_TAG));
|
||||
bool bZoom = pPlayer->InCond(TF_COND_ZOOMED);
|
||||
float flFOV = Math::CalcFov(H::Entities.GetEyeAngles(iIndex) + H::Entities.GetPingAngles(iIndex), Math::CalcAngle(vPlayerEye, bZoom ? vTargetEye : vTargetCenter));
|
||||
float flFOV = Math::CalcFov(H::Entities.GetEyeAngles(iIndex) + H::Entities.GetDeltaAngles(iIndex), Math::CalcAngle(vPlayerEye, bZoom ? vTargetEye : vTargetCenter));
|
||||
bool bFOV = bCheater || flFOV < (bZoom ? 10 : eWeaponType == EWeaponType::HITSCAN ? 30 : 90);
|
||||
if (!bFOV || !TraceToEntity(pTarget, pPlayer, vTargetCenter, vPlayerEye))
|
||||
continue;
|
||||
|
||||
@@ -134,11 +134,14 @@ void CBinds::SetVars(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, bool bManage)
|
||||
GetBinds(DEFAULT_BIND, pLocal, pWeapon, m_vBinds, bManage);
|
||||
}
|
||||
|
||||
void CBinds::Run(CTFPlayer* pLocal, CTFWeaponBase* pWeapon)
|
||||
void CBinds::Run()
|
||||
{
|
||||
if (G::Unload)
|
||||
return;
|
||||
|
||||
auto pLocal = H::Entities.GetLocal();
|
||||
auto pWeapon = H::Entities.GetWeapon();
|
||||
|
||||
for (auto& tBind : m_vBinds)
|
||||
{ // don't delay inputs for binds
|
||||
if (tBind.m_iType != BindEnum::Key)
|
||||
|
||||
@@ -32,7 +32,7 @@ struct Bind_t
|
||||
class CBinds
|
||||
{
|
||||
public:
|
||||
void Run(CTFPlayer* pLocal, CTFWeaponBase* pWeapon);
|
||||
void Run();
|
||||
void SetVars(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, bool bManage = true);
|
||||
|
||||
bool GetBind(int iID, Bind_t* pBind);
|
||||
|
||||
@@ -21,14 +21,13 @@ void CNetworkFix::FixInputDelay(bool bFinalTick)
|
||||
if (!Vars::Misc::Game::NetworkFix.Value || !I::EngineClient->IsInGame() || SDK::IsLoopback())
|
||||
return;
|
||||
|
||||
CReadPacketState Backup = {};
|
||||
Backup.Store();
|
||||
m_tBackup.Store();
|
||||
|
||||
static auto CL_ReadPackets = U::Hooks.m_mHooks["CL_ReadPackets"];
|
||||
CL_ReadPackets->Call<void>(bFinalTick);
|
||||
m_State.Store();
|
||||
|
||||
Backup.Restore();
|
||||
m_tState.Store();
|
||||
m_tBackup.Restore();
|
||||
}
|
||||
|
||||
bool CNetworkFix::ShouldReadPackets()
|
||||
@@ -36,6 +35,6 @@ bool CNetworkFix::ShouldReadPackets()
|
||||
if (!Vars::Misc::Game::NetworkFix.Value || !I::EngineClient->IsInGame() || SDK::IsLoopback())
|
||||
return true;
|
||||
|
||||
m_State.Restore();
|
||||
m_tState.Restore();
|
||||
return false;
|
||||
}
|
||||
@@ -17,7 +17,8 @@ public:
|
||||
class CNetworkFix
|
||||
{
|
||||
private:
|
||||
CReadPacketState m_State = {};
|
||||
CReadPacketState m_tState = {};
|
||||
CReadPacketState m_tBackup = {};
|
||||
|
||||
public:
|
||||
void FixInputDelay(bool bFinalTick);
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include "Ticks.h"
|
||||
|
||||
#include "../NetworkFix/NetworkFix.h"
|
||||
#include "../PacketManip/AntiAim/AntiAim.h"
|
||||
#include "../EnginePrediction/EnginePrediction.h"
|
||||
#include "../Aimbot/AutoRocketJump/AutoRocketJump.h"
|
||||
@@ -166,10 +165,9 @@ void CTicks::MoveFunc(float accumulated_extra_samples, bool bFinalTick)
|
||||
CL_Move->Call<void>(accumulated_extra_samples, bFinalTick);
|
||||
}
|
||||
|
||||
void CTicks::Move(float accumulated_extra_samples, bool bFinalTick, CTFPlayer* pLocal)
|
||||
void CTicks::Move(float accumulated_extra_samples, bool bFinalTick)
|
||||
{
|
||||
F::NetworkFix.FixInputDelay(bFinalTick);
|
||||
MoveManage(pLocal);
|
||||
MoveManage();
|
||||
|
||||
if (auto pWeapon = H::Entities.GetWeapon())
|
||||
{
|
||||
@@ -232,8 +230,9 @@ void CTicks::Move(float accumulated_extra_samples, bool bFinalTick, CTFPlayer* p
|
||||
}
|
||||
}
|
||||
|
||||
void CTicks::MoveManage(CTFPlayer* pLocal)
|
||||
void CTicks::MoveManage()
|
||||
{
|
||||
auto pLocal = H::Entities.GetLocal();
|
||||
if (!pLocal)
|
||||
return;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ class CTicks
|
||||
{
|
||||
private:
|
||||
void MoveFunc(float accumulated_extra_samples, bool bFinalTick);
|
||||
void MoveManage(CTFPlayer* pLocal);
|
||||
void MoveManage();
|
||||
|
||||
void Recharge(CTFPlayer* pLocal);
|
||||
void Warp();
|
||||
@@ -25,7 +25,7 @@ private:
|
||||
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 Move(float accumulated_extra_samples, bool bFinalTick);
|
||||
void CreateMove(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, CUserCmd* pCmd, bool* pSendPacket);
|
||||
void Draw(CTFPlayer* pLocal);
|
||||
void Reset();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "../SDK/SDK.h"
|
||||
|
||||
#include "../Features/NetworkFix/NetworkFix.h"
|
||||
#include "../Features/Ticks/Ticks.h"
|
||||
#include "../Features/Binds/Binds.h"
|
||||
#include "../Features/Players/PlayerCore.h"
|
||||
@@ -20,20 +21,18 @@ MAKE_HOOK(CL_Move, S::CL_Move(), void,
|
||||
if (G::Unload)
|
||||
return CALL_ORIGINAL(accumulated_extra_samples, bFinalTick);
|
||||
|
||||
F::NetworkFix.FixInputDelay(bFinalTick);
|
||||
F::Backtrack.m_iTickCount = I::GlobalVars->tickcount + 1;
|
||||
if (!Vars::Misc::Game::NetworkFix.Value && !SDK::IsLoopback())
|
||||
F::Backtrack.m_iTickCount--;
|
||||
|
||||
auto pLocal = H::Entities.GetLocal();
|
||||
auto pWeapon = H::Entities.GetWeapon();
|
||||
|
||||
F::Binds.Run(pLocal, pWeapon);
|
||||
F::Binds.Run();
|
||||
F::PlayerCore.Run();
|
||||
F::Backtrack.SendLerp();
|
||||
F::Misc.PingReducer();
|
||||
F::AutoQueue.Run();
|
||||
|
||||
F::Ticks.Move(accumulated_extra_samples, bFinalTick, pLocal);
|
||||
F::Ticks.Move(accumulated_extra_samples, bFinalTick);
|
||||
|
||||
for (auto& Line : G::PathStorage)
|
||||
{
|
||||
|
||||
@@ -139,6 +139,7 @@ public:
|
||||
NETVAR(m_nExperienceLevelProgress, int, "CTFPlayer", "m_nExperienceLevelProgress");
|
||||
NETVAR(m_bMatchSafeToLeave, bool, "CTFPlayer", "m_bMatchSafeToLeave");
|
||||
NETVAR(m_vecOrigin, Vec3, "CTFPlayer", "m_vecOrigin");
|
||||
NETVAR(m_angEyeAngles, Vec3, "CTFPlayer", "m_angEyeAngles[0]");
|
||||
NETVAR(m_angEyeAnglesX, float, "CTFPlayer", "m_angEyeAngles[0]");
|
||||
NETVAR(m_angEyeAnglesY, float, "CTFPlayer", "m_angEyeAngles[1]");
|
||||
NETVAR(m_bAllowMoveDuringTaunt, bool, "CTFPlayer", "m_bAllowMoveDuringTaunt");
|
||||
|
||||
@@ -488,7 +488,7 @@ float CEntities::GetLagTime(int iIndex) { return m_mLagTimes.contains(iIndex) ?
|
||||
int CEntities::GetChoke(int iIndex) { return m_mChokes.contains(iIndex) ? m_mChokes[iIndex] : 0; }
|
||||
bool CEntities::GetDormancy(int iIndex) { return m_mDormancy.contains(iIndex); }
|
||||
Vec3 CEntities::GetEyeAngles(int iIndex) { return m_mEyeAngles.contains(iIndex) ? m_mEyeAngles[iIndex] : Vec3(); }
|
||||
Vec3 CEntities::GetPingAngles(int iIndex) { return m_mOldAngles.contains(iIndex) ? (m_mEyeAngles[iIndex] - m_mOldAngles[iIndex]) / GetLagTime(iIndex) * (F::Backtrack.GetReal() + TICKS_TO_TIME(F::Backtrack.GetAnticipatedChoke())) : Vec3(); }
|
||||
Vec3 CEntities::GetDeltaAngles(int iIndex) { return m_mOldAngles.contains(iIndex) ? m_mEyeAngles[iIndex].DeltaAngle(m_mOldAngles[iIndex]) / GetLagTime(iIndex) * (F::Backtrack.GetReal() + TICKS_TO_TIME(F::Backtrack.GetAnticipatedChoke())) : Vec3(); }
|
||||
bool CEntities::GetLagCompensation(int iIndex) { return m_mLagCompensation[iIndex]; }
|
||||
void CEntities::SetLagCompensation(int iIndex, bool bLagComp) { m_mLagCompensation[iIndex] = bLagComp; }
|
||||
Vec3* CEntities::GetAvgVelocity(int iIndex) { return iIndex != I::EngineClient->GetLocalPlayer() ? &m_mAvgVelocities[iIndex] : nullptr; }
|
||||
|
||||
@@ -76,7 +76,7 @@ public:
|
||||
float GetLagTime(int iIndex);
|
||||
int GetChoke(int iIndex);
|
||||
Vec3 GetEyeAngles(int iIndex);
|
||||
Vec3 GetPingAngles(int iIndex);
|
||||
Vec3 GetDeltaAngles(int iIndex);
|
||||
bool GetLagCompensation(int iIndex);
|
||||
void SetLagCompensation(int iIndex, bool bLagComp);
|
||||
bool GetDormancy(int iIndex);
|
||||
|
||||
Reference in New Issue
Block a user