mirror of
https://github.com/rei-2/Amalgam.git
synced 2026-10-12 02:08:13 +08:00
misc fixes and changes
This commit is contained in:
1 parent
c8c64c854c
commit
9770b02ec9
22 files changed
+259
-227
No files matched your search
@@ -58,6 +58,8 @@ bool CAimbotGlobal::IsHitboxValid(uint32_t uHash, int nHitbox, int iHitboxes)
|
||||
switch (uHash)
|
||||
{
|
||||
case FNV1A::Hash32Const("models/vsh/player/saxton_hale.mdl"):
|
||||
case FNV1A::Hash32Const("models/vsh/player/hell_hale.mdl"):
|
||||
case FNV1A::Hash32Const("models/vsh/player/santa_hale.mdl"):
|
||||
{
|
||||
switch (nHitbox)
|
||||
{
|
||||
|
||||
@@ -207,6 +207,8 @@ int CAimbotHitscan::GetHitboxPriority(int nHitbox, CTFPlayer* pLocal, CTFWeaponB
|
||||
switch (H::Entities.GetModel(pTarget->entindex()))
|
||||
{
|
||||
case FNV1A::Hash32Const("models/vsh/player/saxton_hale.mdl"):
|
||||
case FNV1A::Hash32Const("models/vsh/player/hell_hale.mdl"):
|
||||
case FNV1A::Hash32Const("models/vsh/player/santa_hale.mdl"):
|
||||
{
|
||||
switch (nHitbox)
|
||||
{
|
||||
@@ -632,36 +634,40 @@ bool CAimbotHitscan::ShouldFire(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, CUser
|
||||
|
||||
bool CAimbotHitscan::Aim(Vec3 vCurAngle, Vec3 vToAngle, Vec3& vOut, int iMethod)
|
||||
{
|
||||
auto pLocal = H::Entities.GetLocal();
|
||||
Vec3 vPunch = pLocal ? pLocal->m_vecPunchAngle() : Vec3();
|
||||
|
||||
if (Vec3* pDoubletapAngle = F::Ticks.GetShootAngle())
|
||||
{
|
||||
vOut = *pDoubletapAngle;
|
||||
vOut = *pDoubletapAngle - vPunch;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (auto pLocal = H::Entities.GetLocal())
|
||||
vToAngle -= pLocal->m_vecPunchAngle();
|
||||
Math::ClampAngles(vToAngle);
|
||||
|
||||
bool bReturn = false;
|
||||
vToAngle -= vPunch;
|
||||
switch (iMethod)
|
||||
{
|
||||
case Vars::Aimbot::General::AimTypeEnum::Plain:
|
||||
case Vars::Aimbot::General::AimTypeEnum::Silent:
|
||||
case Vars::Aimbot::General::AimTypeEnum::Locking:
|
||||
vOut = vToAngle;
|
||||
return false;
|
||||
break;
|
||||
case Vars::Aimbot::General::AimTypeEnum::Smooth:
|
||||
vOut = vCurAngle.LerpAngle(vToAngle, Vars::Aimbot::General::AssistStrength.Value / 100.f);
|
||||
return true;
|
||||
bReturn = true;
|
||||
break;
|
||||
case Vars::Aimbot::General::AimTypeEnum::Assistive:
|
||||
Vec3 vMouseDelta = G::CurrentUserCmd->viewangles.DeltaAngle(G::LastUserCmd->viewangles);
|
||||
Vec3 vTargetDelta = vToAngle.DeltaAngle(G::LastUserCmd->viewangles);
|
||||
float flMouseDelta = vMouseDelta.Length2D(), flTargetDelta = vTargetDelta.Length2D();
|
||||
vTargetDelta = vTargetDelta.Normalized() * std::min(flMouseDelta, flTargetDelta);
|
||||
vOut = vCurAngle - vMouseDelta + vMouseDelta.LerpAngle(vTargetDelta, Vars::Aimbot::General::AssistStrength.Value / 100.f);
|
||||
return true;
|
||||
bReturn = true;
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
Math::ClampAngles(vOut);
|
||||
return bReturn;
|
||||
}
|
||||
|
||||
// assume angle calculated outside with other overload
|
||||
|
||||
@@ -365,28 +365,30 @@ bool CAimbotMelee::Aim(Vec3 vCurAngle, Vec3 vToAngle, Vec3& vOut, int iMethod)
|
||||
return true;
|
||||
}
|
||||
|
||||
Math::ClampAngles(vToAngle);
|
||||
|
||||
bool bReturn = false;
|
||||
switch (iMethod)
|
||||
{
|
||||
case Vars::Aimbot::General::AimTypeEnum::Plain:
|
||||
case Vars::Aimbot::General::AimTypeEnum::Silent:
|
||||
case Vars::Aimbot::General::AimTypeEnum::Locking:
|
||||
vOut = vToAngle;
|
||||
return false;
|
||||
break;
|
||||
case Vars::Aimbot::General::AimTypeEnum::Smooth:
|
||||
vOut = vCurAngle.LerpAngle(vToAngle, Vars::Aimbot::General::AssistStrength.Value / 100.f);
|
||||
return true;
|
||||
bReturn = true;
|
||||
break;
|
||||
case Vars::Aimbot::General::AimTypeEnum::Assistive:
|
||||
Vec3 vMouseDelta = G::CurrentUserCmd->viewangles.DeltaAngle(G::LastUserCmd->viewangles);
|
||||
Vec3 vTargetDelta = vToAngle.DeltaAngle(G::LastUserCmd->viewangles);
|
||||
float flMouseDelta = vMouseDelta.Length2D(), flTargetDelta = vTargetDelta.Length2D();
|
||||
vTargetDelta = vTargetDelta.Normalized() * std::min(flMouseDelta, flTargetDelta);
|
||||
vOut = vCurAngle - vMouseDelta + vMouseDelta.LerpAngle(vTargetDelta, Vars::Aimbot::General::AssistStrength.Value / 100.f);
|
||||
return true;
|
||||
bReturn = true;
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
Math::ClampAngles(vOut);
|
||||
return bReturn;
|
||||
}
|
||||
|
||||
// assume angle calculated outside with other overload
|
||||
|
||||
@@ -1496,24 +1496,24 @@ int CAimbotProjectile::CanHit(Target_t& tTarget, CTFPlayer* pLocal, CTFWeaponBas
|
||||
else switch (Vars::Aimbot::General::AimType.Value)
|
||||
{
|
||||
case Vars::Aimbot::General::AimTypeEnum::Smooth:
|
||||
if (Vars::Aimbot::General::AssistStrength.Value == 100.f)
|
||||
break;
|
||||
[[fallthrough]];
|
||||
case Vars::Aimbot::General::AimTypeEnum::Assistive:
|
||||
{
|
||||
if (/*Vars::Aimbot::General::AssistStrength.Value != 0.f &&*/ Vars::Aimbot::General::AssistStrength.Value != 100.f)
|
||||
{
|
||||
bPriority = bSplash ? iPriority <= iLowestSmoothPriority : iPriority < flLowestSmoothDist;
|
||||
bDist = !bSplash || flDist < flLowestDist;
|
||||
if (!bPriority || !bDist)
|
||||
continue;
|
||||
bPriority = bSplash ? iPriority <= iLowestSmoothPriority : iPriority < flLowestSmoothDist;
|
||||
bDist = !bSplash || flDist < flLowestDist;
|
||||
if (!bPriority || !bDist)
|
||||
continue;
|
||||
|
||||
Vec3 vPlainAngles; Aim({}, { vPoint.m_Solution.m_flPitch, vPoint.m_Solution.m_flYaw, 0.f }, vPlainAngles, Vars::Aimbot::General::AimTypeEnum::Plain);
|
||||
if (TestAngle(pLocal, pWeapon, tTarget, vPoint.m_vPoint, vPlainAngles, i, bSplash, &bHitSolid))
|
||||
{
|
||||
iLowestSmoothPriority = iPriority; flLowestSmoothDist = flDist;
|
||||
vAngleTo = vAngles, vPredicted = tTarget.m_vPos;
|
||||
m_vPlayerPath = tStorage.m_vPath;
|
||||
m_vPlayerPath.push_back(tStorage.m_MoveData.m_vecAbsOrigin);
|
||||
iReturn = 2;
|
||||
}
|
||||
Vec3 vPlainAngles; Aim({}, { vPoint.m_Solution.m_flPitch, vPoint.m_Solution.m_flYaw, 0.f }, vPlainAngles, Vars::Aimbot::General::AimTypeEnum::Plain);
|
||||
if (TestAngle(pLocal, pWeapon, tTarget, vPoint.m_vPoint, vPlainAngles, i, bSplash, &bHitSolid))
|
||||
{
|
||||
iLowestSmoothPriority = iPriority; flLowestSmoothDist = flDist;
|
||||
vAngleTo = vAngles, vPredicted = tTarget.m_vPos;
|
||||
m_vPlayerPath = tStorage.m_vPath;
|
||||
m_vPlayerPath.push_back(tStorage.m_MoveData.m_vecAbsOrigin);
|
||||
iReturn = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1573,28 +1573,30 @@ bool CAimbotProjectile::Aim(Vec3 vCurAngle, Vec3 vToAngle, Vec3& vOut, int iMeth
|
||||
return true;
|
||||
}
|
||||
|
||||
Math::ClampAngles(vToAngle);
|
||||
|
||||
bool bReturn = false;
|
||||
switch (iMethod)
|
||||
{
|
||||
case Vars::Aimbot::General::AimTypeEnum::Plain:
|
||||
case Vars::Aimbot::General::AimTypeEnum::Silent:
|
||||
case Vars::Aimbot::General::AimTypeEnum::Locking:
|
||||
vOut = vToAngle;
|
||||
return false;
|
||||
break;
|
||||
case Vars::Aimbot::General::AimTypeEnum::Smooth:
|
||||
vOut = vCurAngle.LerpAngle(vToAngle, Vars::Aimbot::General::AssistStrength.Value / 100.f);
|
||||
return true;
|
||||
bReturn = true;
|
||||
break;
|
||||
case Vars::Aimbot::General::AimTypeEnum::Assistive:
|
||||
Vec3 vMouseDelta = G::CurrentUserCmd->viewangles.DeltaAngle(G::LastUserCmd->viewangles);
|
||||
Vec3 vTargetDelta = vToAngle.DeltaAngle(G::LastUserCmd->viewangles);
|
||||
float flMouseDelta = vMouseDelta.Length2D(), flTargetDelta = vTargetDelta.Length2D();
|
||||
vTargetDelta = vTargetDelta.Normalized() * std::min(flMouseDelta, flTargetDelta);
|
||||
vOut = vCurAngle - vMouseDelta + vMouseDelta.LerpAngle(vTargetDelta, Vars::Aimbot::General::AssistStrength.Value / 100.f);
|
||||
return true;
|
||||
bReturn = true;
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
Math::ClampAngles(vOut);
|
||||
return bReturn;
|
||||
}
|
||||
|
||||
// assume angle calculated outside with other overload
|
||||
|
||||
@@ -12,19 +12,6 @@ void CBacktrack::Reset()
|
||||
|
||||
|
||||
|
||||
float CBacktrack::GetLerp()
|
||||
{
|
||||
if (Vars::Misc::Game::AntiCheatCompatibility.Value)
|
||||
return std::clamp(Vars::Backtrack::Interp.Value / 1000.f, G::Lerp, 0.1f);
|
||||
|
||||
return std::clamp(Vars::Backtrack::Interp.Value / 1000.f, G::Lerp, m_flMaxUnlag);
|
||||
}
|
||||
|
||||
float CBacktrack::GetFake()
|
||||
{
|
||||
return std::clamp(Vars::Backtrack::Latency.Value / 1000.f, 0.f, m_flMaxUnlag);
|
||||
}
|
||||
|
||||
float CBacktrack::GetReal(int iFlow, bool bNoFake)
|
||||
{
|
||||
auto pNetChan = I::EngineClient->GetNetChannelInfo();
|
||||
@@ -32,8 +19,26 @@ float CBacktrack::GetReal(int iFlow, bool bNoFake)
|
||||
return 0.f;
|
||||
|
||||
if (iFlow != MAX_FLOWS)
|
||||
return pNetChan->GetLatency(iFlow) - (bNoFake && iFlow == FLOW_INCOMING ? m_flFakeLatency : 0.f);
|
||||
return pNetChan->GetLatency(FLOW_INCOMING) + pNetChan->GetLatency(FLOW_OUTGOING) - (bNoFake ? m_flFakeLatency : 0.f);
|
||||
return pNetChan->GetLatency(iFlow) - (bNoFake && iFlow == FLOW_INCOMING ? GetFakeLatency() : 0.f);
|
||||
return pNetChan->GetLatency(FLOW_INCOMING) + pNetChan->GetLatency(FLOW_OUTGOING) - (bNoFake ? GetFakeLatency() : 0.f);
|
||||
}
|
||||
|
||||
float CBacktrack::GetWishFake()
|
||||
{
|
||||
return std::clamp(Vars::Backtrack::Latency.Value / 1000.f, 0.f, m_flMaxUnlag);
|
||||
}
|
||||
|
||||
float CBacktrack::GetWishLerp()
|
||||
{
|
||||
if (Vars::Misc::Game::AntiCheatCompatibility.Value)
|
||||
return std::clamp(Vars::Backtrack::Interp.Value / 1000.f, G::Lerp, 0.1f);
|
||||
|
||||
return std::clamp(Vars::Backtrack::Interp.Value / 1000.f, G::Lerp, m_flMaxUnlag);
|
||||
}
|
||||
|
||||
float CBacktrack::GetFakeLatency()
|
||||
{
|
||||
return m_flFakeLatency;
|
||||
}
|
||||
|
||||
float CBacktrack::GetFakeInterp()
|
||||
@@ -44,6 +49,11 @@ float CBacktrack::GetFakeInterp()
|
||||
return m_flFakeInterp;
|
||||
}
|
||||
|
||||
float CBacktrack::GetWindow()
|
||||
{
|
||||
return Vars::Backtrack::Window.Value / 1000.f;
|
||||
}
|
||||
|
||||
int CBacktrack::GetAnticipatedChoke(int iMethod)
|
||||
{
|
||||
int iAnticipatedChoke = 0;
|
||||
@@ -60,15 +70,15 @@ void CBacktrack::SendLerp()
|
||||
if (!tTimer.Run(0.1f))
|
||||
return;
|
||||
|
||||
float flTarget = GetLerp();
|
||||
if (m_flWishInterp != flTarget)
|
||||
float flTarget = GetWishLerp();
|
||||
if (m_flSentInterp != flTarget)
|
||||
{
|
||||
m_flWishInterp = flTarget;
|
||||
m_flSentInterp = flTarget;
|
||||
|
||||
auto pNetChan = reinterpret_cast<CNetChannel*>(I::EngineClient->GetNetChannelInfo());
|
||||
if (pNetChan && I::EngineClient->IsConnected())
|
||||
{
|
||||
NET_SetConVar tConvar1 = { "cl_interp", std::to_string(m_flWishInterp).c_str() };
|
||||
NET_SetConVar tConvar1 = { "cl_interp", std::to_string(m_flSentInterp).c_str() };
|
||||
pNetChan->SendNetMsg(tConvar1);
|
||||
|
||||
NET_SetConVar tConvar2 = { "cl_interp_ratio", "1" };
|
||||
@@ -83,7 +93,7 @@ void CBacktrack::SendLerp()
|
||||
void CBacktrack::SetLerp(IGameEvent* pEvent)
|
||||
{
|
||||
if (I::EngineClient->GetPlayerForUserID(pEvent->GetInt("userid")) == I::EngineClient->GetLocalPlayer())
|
||||
m_flFakeInterp = m_flWishInterp;
|
||||
m_flFakeInterp = m_flSentInterp;
|
||||
}
|
||||
|
||||
void CBacktrack::UpdateDatagram()
|
||||
@@ -131,12 +141,12 @@ std::vector<TickRecord*> CBacktrack::GetValidRecords(std::vector<TickRecord*>& v
|
||||
float flCorrect = std::clamp(GetReal(MAX_FLOWS, false) + ROUND_TO_TICKS(GetFakeInterp()), 0.f, m_flMaxUnlag);
|
||||
int iServerTick = m_iTickCount + GetAnticipatedChoke() + Vars::Backtrack::Offset.Value + TIME_TO_TICKS(GetReal(FLOW_OUTGOING));
|
||||
|
||||
if (!Vars::Misc::Game::AntiCheatCompatibility.Value && Vars::Backtrack::Window.Value)
|
||||
if (!Vars::Misc::Game::AntiCheatCompatibility.Value && GetWindow())
|
||||
{
|
||||
for (auto pRecord : vRecords)
|
||||
{
|
||||
float flDelta = fabsf(flCorrect - TICKS_TO_TIME(iServerTick - TIME_TO_TICKS(pRecord->m_flSimTime + flTimeMod)));
|
||||
if (flDelta > Vars::Backtrack::Window.Value / 1000.f)
|
||||
if (flDelta > GetWindow())
|
||||
continue;
|
||||
|
||||
vReturn.push_back(pRecord);
|
||||
@@ -337,7 +347,7 @@ void CBacktrack::AdjustPing(CNetChannel* pNetChan)
|
||||
float flTimescale = host_timescale->GetFloat();
|
||||
|
||||
static float flStaticReal = 0.f;
|
||||
float flFake = GetFake(), flReal = TICKS_TO_TIME(pLocal->m_nTickBase() - m_nOldTickBase);
|
||||
float flFake = GetWishFake(), flReal = TICKS_TO_TIME(pLocal->m_nTickBase() - m_nOldTickBase);
|
||||
flStaticReal += (flReal + 5 * TICK_INTERVAL - flStaticReal) * 0.1f;
|
||||
|
||||
int nInReliableState = pNetChan->m_nInReliableState, nInSequenceNr = pNetChan->m_nInSequenceNr; float flLatency = 0.f;
|
||||
@@ -388,7 +398,7 @@ void CBacktrack::Draw(CTFPlayer* pLocal)
|
||||
{
|
||||
static Timer tTimer = {};
|
||||
if (tTimer.Run(0.5f))
|
||||
flFakeLatency = m_flFakeLatency;
|
||||
flFakeLatency = GetFakeLatency();
|
||||
}
|
||||
float flFakeLerp = GetFakeInterp() > G::Lerp ? GetFakeInterp() : 0.f;
|
||||
|
||||
|
||||
@@ -50,6 +50,9 @@ class CBacktrack
|
||||
int m_nOldTickBase = 0;
|
||||
float m_flMaxUnlag = 1.f;
|
||||
|
||||
float m_flFakeLatency = 0.f;
|
||||
float m_flFakeInterp = 0.015f;
|
||||
|
||||
public:
|
||||
void Store();
|
||||
void SendLerp();
|
||||
@@ -59,10 +62,12 @@ public:
|
||||
bool GetRecords(CBaseEntity* pEntity, std::vector<TickRecord*>& vReturn);
|
||||
std::vector<TickRecord*> GetValidRecords(std::vector<TickRecord*>& vRecords, CTFPlayer* pLocal = nullptr, bool bDistance = false, float flTimeMod = 0.f);
|
||||
|
||||
float GetLerp();
|
||||
float GetFake();
|
||||
float GetReal(int iFlow = MAX_FLOWS, bool bNoFake = true);
|
||||
float GetWishFake();
|
||||
float GetWishLerp();
|
||||
float GetFakeLatency();
|
||||
float GetFakeInterp();
|
||||
float GetWindow();
|
||||
void SetLerp(IGameEvent* pEvent);
|
||||
int GetAnticipatedChoke(int iMethod = Vars::Aimbot::General::AimType.Value);
|
||||
|
||||
@@ -72,10 +77,7 @@ public:
|
||||
void RestorePing(CNetChannel* netChannel);
|
||||
|
||||
int m_iTickCount = 0;
|
||||
|
||||
float m_flFakeLatency = 0.f;
|
||||
float m_flFakeInterp = 0.015f;
|
||||
float m_flWishInterp = -1.f;
|
||||
float m_flSentInterp = -1.f;
|
||||
|
||||
TickRecord m_tRecord = {}; // for temporary use
|
||||
};
|
||||
|
||||
@@ -550,7 +550,7 @@ void CMisc::PingReducer()
|
||||
|
||||
void CMisc::UnlockAchievements()
|
||||
{
|
||||
const auto pAchievementMgr = reinterpret_cast<IAchievementMgr*(*)(void)>(U::Memory.GetVirtual(I::EngineClient, 114))();
|
||||
const auto pAchievementMgr = U::Memory.CallVirtual<114, IAchievementMgr*>(I::EngineClient);
|
||||
if (pAchievementMgr)
|
||||
{
|
||||
I::SteamUserStats->RequestCurrentStats();
|
||||
@@ -563,7 +563,7 @@ void CMisc::UnlockAchievements()
|
||||
|
||||
void CMisc::LockAchievements()
|
||||
{
|
||||
const auto pAchievementMgr = reinterpret_cast<IAchievementMgr*(*)(void)>(U::Memory.GetVirtual(I::EngineClient, 114))();
|
||||
const auto pAchievementMgr = U::Memory.CallVirtual<114, IAchievementMgr*>(I::EngineClient);
|
||||
if (pAchievementMgr)
|
||||
{
|
||||
I::SteamUserStats->RequestCurrentStats();
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
#include "../Aimbot/AutoRocketJump/AutoRocketJump.h"
|
||||
#include "../Backtrack/Backtrack.h"
|
||||
|
||||
void CTickshiftHandler::Reset()
|
||||
void CTicks::Reset()
|
||||
{
|
||||
m_bSpeedhack = m_bDoubletap = m_bRecharge = m_bWarp = false;
|
||||
m_iShiftedTicks = m_iShiftedGoal = 0;
|
||||
}
|
||||
|
||||
void CTickshiftHandler::Recharge(CTFPlayer* pLocal)
|
||||
void CTicks::Recharge(CTFPlayer* pLocal)
|
||||
{
|
||||
if (!m_bGoalReached)
|
||||
return;
|
||||
@@ -40,7 +40,7 @@ void CTickshiftHandler::Recharge(CTFPlayer* pLocal)
|
||||
m_iShiftedGoal = m_iShiftedTicks + 1;
|
||||
}
|
||||
|
||||
void CTickshiftHandler::Warp()
|
||||
void CTicks::Warp()
|
||||
{
|
||||
if (!m_bGoalReached)
|
||||
return;
|
||||
@@ -54,7 +54,7 @@ void CTickshiftHandler::Warp()
|
||||
m_iShiftedGoal = std::max(m_iShiftedTicks - Vars::Doubletap::WarpRate.Value + 1, 0);
|
||||
}
|
||||
|
||||
void CTickshiftHandler::Doubletap(CTFPlayer* pLocal, CUserCmd* pCmd)
|
||||
void CTicks::Doubletap(CTFPlayer* pLocal, CUserCmd* pCmd)
|
||||
{
|
||||
if (!m_bGoalReached)
|
||||
return;
|
||||
@@ -78,7 +78,7 @@ void CTickshiftHandler::Doubletap(CTFPlayer* pLocal, CUserCmd* pCmd)
|
||||
m_bAntiWarp = pLocal->m_hGroundEntity();
|
||||
}
|
||||
|
||||
void CTickshiftHandler::Speedhack()
|
||||
void CTicks::Speedhack()
|
||||
{
|
||||
m_bSpeedhack = Vars::Speedhack::Enabled.Value;
|
||||
if (!m_bSpeedhack)
|
||||
@@ -87,17 +87,17 @@ void CTickshiftHandler::Speedhack()
|
||||
m_bDoubletap = m_bWarp = m_bRecharge = false;
|
||||
}
|
||||
|
||||
void CTickshiftHandler::SaveShootPos(CTFPlayer* pLocal)
|
||||
void CTicks::SaveShootPos(CTFPlayer* pLocal)
|
||||
{
|
||||
if (!m_bDoubletap && !m_bWarp)
|
||||
m_vShootPos = pLocal->GetShootPos();
|
||||
}
|
||||
Vec3 CTickshiftHandler::GetShootPos()
|
||||
Vec3 CTicks::GetShootPos()
|
||||
{
|
||||
return m_vShootPos;
|
||||
}
|
||||
|
||||
void CTickshiftHandler::SaveShootAngle(CUserCmd* pCmd, bool bSendPacket)
|
||||
void CTicks::SaveShootAngle(CUserCmd* pCmd, bool bSendPacket)
|
||||
{
|
||||
static auto sv_maxusrcmdprocessticks_holdaim = U::ConVars.FindVar("sv_maxusrcmdprocessticks_holdaim");
|
||||
|
||||
@@ -106,14 +106,14 @@ void CTickshiftHandler::SaveShootAngle(CUserCmd* pCmd, bool bSendPacket)
|
||||
else if (!m_bShootAngle && G::Attacking == 1 && sv_maxusrcmdprocessticks_holdaim->GetBool())
|
||||
m_vShootAngle = pCmd->viewangles, m_bShootAngle = true;
|
||||
}
|
||||
Vec3* CTickshiftHandler::GetShootAngle()
|
||||
Vec3* CTicks::GetShootAngle()
|
||||
{
|
||||
if (m_bShootAngle && I::ClientState->chokedcommands)
|
||||
return &m_vShootAngle;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool CTickshiftHandler::CanChoke()
|
||||
bool CTicks::CanChoke()
|
||||
{
|
||||
static auto sv_maxusrcmdprocessticks = U::ConVars.FindVar("sv_maxusrcmdprocessticks");
|
||||
int iMaxTicks = sv_maxusrcmdprocessticks->GetInt();
|
||||
@@ -123,7 +123,7 @@ bool CTickshiftHandler::CanChoke()
|
||||
return I::ClientState->chokedcommands < 21 && m_iShiftedTicks + I::ClientState->chokedcommands < iMaxTicks;
|
||||
}
|
||||
|
||||
void CTickshiftHandler::AntiWarp(CTFPlayer* pLocal, CUserCmd* pCmd)
|
||||
void CTicks::AntiWarp(CTFPlayer* pLocal, CUserCmd* pCmd)
|
||||
{
|
||||
static Vec3 vVelocity = {};
|
||||
static int iMaxTicks = 0;
|
||||
@@ -172,7 +172,7 @@ void CTickshiftHandler::AntiWarp(CTFPlayer* pLocal, CUserCmd* pCmd)
|
||||
*/
|
||||
}
|
||||
|
||||
bool CTickshiftHandler::ValidWeapon(CTFWeaponBase* pWeapon)
|
||||
bool CTicks::ValidWeapon(CTFWeaponBase* pWeapon)
|
||||
{
|
||||
switch (pWeapon->GetWeaponID())
|
||||
{
|
||||
@@ -202,7 +202,7 @@ bool CTickshiftHandler::ValidWeapon(CTFWeaponBase* pWeapon)
|
||||
return true;
|
||||
}
|
||||
|
||||
void CTickshiftHandler::CLMoveFunc(float accumulated_extra_samples, bool bFinalTick)
|
||||
void CTicks::CLMoveFunc(float accumulated_extra_samples, bool bFinalTick)
|
||||
{
|
||||
static auto CL_Move = U::Hooks.m_mHooks["CL_Move"];
|
||||
|
||||
@@ -223,7 +223,7 @@ void CTickshiftHandler::CLMoveFunc(float accumulated_extra_samples, bool bFinalT
|
||||
CL_Move->Call<void>(accumulated_extra_samples, bFinalTick);
|
||||
}
|
||||
|
||||
void CTickshiftHandler::CLMove(float accumulated_extra_samples, bool bFinalTick)
|
||||
void CTicks::CLMove(float accumulated_extra_samples, bool bFinalTick)
|
||||
{
|
||||
if (auto pWeapon = H::Entities.GetWeapon())
|
||||
{
|
||||
@@ -305,7 +305,7 @@ void CTickshiftHandler::CLMove(float accumulated_extra_samples, bool bFinalTick)
|
||||
}
|
||||
}
|
||||
|
||||
void CTickshiftHandler::CLMoveManage(CTFPlayer* pLocal)
|
||||
void CTicks::CLMoveManage(CTFPlayer* pLocal)
|
||||
{
|
||||
if (!pLocal)
|
||||
return;
|
||||
@@ -315,7 +315,7 @@ void CTickshiftHandler::CLMoveManage(CTFPlayer* pLocal)
|
||||
Speedhack();
|
||||
}
|
||||
|
||||
void CTickshiftHandler::Run(float accumulated_extra_samples, bool bFinalTick, CTFPlayer* pLocal)
|
||||
void CTicks::Run(float accumulated_extra_samples, bool bFinalTick, CTFPlayer* pLocal)
|
||||
{
|
||||
F::NetworkFix.FixInputDelay(bFinalTick);
|
||||
|
||||
@@ -323,7 +323,7 @@ void CTickshiftHandler::Run(float accumulated_extra_samples, bool bFinalTick, CT
|
||||
CLMove(accumulated_extra_samples, bFinalTick);
|
||||
}
|
||||
|
||||
void CTickshiftHandler::CreateMove(CTFPlayer* pLocal, CUserCmd* pCmd, bool* pSendPacket)
|
||||
void CTicks::CreateMove(CTFPlayer* pLocal, CUserCmd* pCmd, bool* pSendPacket)
|
||||
{
|
||||
if (!pLocal)
|
||||
return;
|
||||
@@ -336,7 +336,7 @@ void CTickshiftHandler::CreateMove(CTFPlayer* pLocal, CUserCmd* pCmd, bool* pSen
|
||||
SaveShootAngle(pCmd, *pSendPacket);
|
||||
}
|
||||
|
||||
void CTickshiftHandler::ManagePacket(CUserCmd* pCmd, bool* pSendPacket)
|
||||
void CTicks::ManagePacket(CUserCmd* pCmd, bool* pSendPacket)
|
||||
{
|
||||
if (!m_bDoubletap && !m_bWarp && !m_bSpeedhack)
|
||||
return;
|
||||
@@ -352,7 +352,7 @@ void CTickshiftHandler::ManagePacket(CUserCmd* pCmd, bool* pSendPacket)
|
||||
*pSendPacket = true;
|
||||
}
|
||||
|
||||
int CTickshiftHandler::GetTicks(CTFWeaponBase* pWeapon)
|
||||
int CTicks::GetTicks(CTFWeaponBase* pWeapon)
|
||||
{
|
||||
if (m_bDoubletap && m_iShiftedGoal < m_iShiftedTicks)
|
||||
return m_iShiftedTicks - m_iShiftedGoal;
|
||||
@@ -368,7 +368,7 @@ int CTickshiftHandler::GetTicks(CTFWeaponBase* pWeapon)
|
||||
return std::min(Vars::Doubletap::TickLimit.Value - 1, m_iMaxShift);
|
||||
}
|
||||
|
||||
int CTickshiftHandler::GetShotsWithinPacket(CTFWeaponBase* pWeapon, int iTicks)
|
||||
int CTicks::GetShotsWithinPacket(CTFWeaponBase* pWeapon, int iTicks)
|
||||
{
|
||||
iTicks = std::min(m_iMaxShift + 1, iTicks);
|
||||
|
||||
@@ -384,7 +384,7 @@ int CTickshiftHandler::GetShotsWithinPacket(CTFWeaponBase* pWeapon, int iTicks)
|
||||
return 1 + (iTicks - iDelay) / std::ceilf(pWeapon->GetFireRate() / TICK_INTERVAL);
|
||||
}
|
||||
|
||||
int CTickshiftHandler::GetMinimumTicksNeeded(CTFWeaponBase* pWeapon)
|
||||
int CTicks::GetMinimumTicksNeeded(CTFWeaponBase* pWeapon)
|
||||
{
|
||||
int iDelay = 1;
|
||||
switch (pWeapon->GetWeaponID())
|
||||
@@ -398,7 +398,7 @@ int CTickshiftHandler::GetMinimumTicksNeeded(CTFWeaponBase* pWeapon)
|
||||
return (GetShotsWithinPacket(pWeapon) - 1) * std::ceilf(pWeapon->GetFireRate() / TICK_INTERVAL) + iDelay;
|
||||
}
|
||||
|
||||
void CTickshiftHandler::Draw(CTFPlayer* pLocal)
|
||||
void CTicks::Draw(CTFPlayer* pLocal)
|
||||
{
|
||||
if (!(Vars::Menu::Indicators.Value & Vars::Menu::IndicatorsEnum::Ticks) || !pLocal->IsAlive())
|
||||
return;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
//#define TICKBASE_DEBUG
|
||||
|
||||
class CTickshiftHandler
|
||||
class CTicks
|
||||
{
|
||||
void CLMoveFunc(float accumulated_extra_samples, bool bFinalTick);
|
||||
|
||||
@@ -59,4 +59,4 @@ public:
|
||||
int m_iDeficit = 0;
|
||||
};
|
||||
|
||||
ADD_FEATURE(CTickshiftHandler, Ticks);
|
||||
ADD_FEATURE(CTicks, Ticks);
|
||||
@@ -298,7 +298,8 @@ void CChams::Store(CTFPlayer* pLocal)
|
||||
if (pEntity->IsPlayer() && !pEntity->IsDormant())
|
||||
{
|
||||
// backtrack
|
||||
if (Vars::Chams::Backtrack::Enabled.Value && pEntity != pLocal)
|
||||
if (Vars::Chams::Backtrack::Enabled.Value && pEntity != pLocal
|
||||
&& (F::Backtrack.GetFakeLatency() || F::Backtrack.GetFakeInterp() > G::Lerp || F::Backtrack.GetWindow()))
|
||||
{
|
||||
auto pWeapon = H::Entities.GetWeapon();
|
||||
if (pWeapon && (G::PrimaryWeaponType != EWeaponType::PROJECTILE || Vars::Chams::Backtrack::Draw.Value & Vars::Chams::Backtrack::DrawEnum::Always))
|
||||
|
||||
@@ -931,6 +931,8 @@ void CESP::DrawPlayers()
|
||||
switch (H::Entities.GetModel(pPlayer->entindex()))
|
||||
{
|
||||
case FNV1A::Hash32Const("models/vsh/player/saxton_hale.mdl"):
|
||||
case FNV1A::Hash32Const("models/vsh/player/hell_hale.mdl"):
|
||||
case FNV1A::Hash32Const("models/vsh/player/santa_hale.mdl"):
|
||||
DrawBones(pPlayer, aBones, { HITBOX_SAXTON_HEAD, HITBOX_SAXTON_CHEST, HITBOX_SAXTON_PELVIS }, tCache.m_tColor);
|
||||
DrawBones(pPlayer, aBones, { HITBOX_SAXTON_CHEST, HITBOX_SAXTON_LEFT_UPPER_ARM, HITBOX_SAXTON_LEFT_FOREARM, HITBOX_SAXTON_LEFT_HAND }, tCache.m_tColor);
|
||||
DrawBones(pPlayer, aBones, { HITBOX_SAXTON_CHEST, HITBOX_SAXTON_RIGHT_UPPER_ARM, HITBOX_SAXTON_RIGHT_FOREARM, HITBOX_SAXTON_RIGHT_HAND }, tCache.m_tColor);
|
||||
|
||||
@@ -322,7 +322,9 @@ void CGlow::Store(CTFPlayer* pLocal)
|
||||
if (pEntity->IsPlayer() && !pEntity->IsDormant())
|
||||
{
|
||||
// backtrack
|
||||
if (Vars::Glow::Backtrack::Enabled.Value && (Vars::Glow::Backtrack::Stencil.Value || Vars::Glow::Backtrack::Blur.Value) && pEntity != pLocal)
|
||||
if (Vars::Glow::Backtrack::Enabled.Value && pEntity != pLocal
|
||||
&& (Vars::Glow::Backtrack::Stencil.Value || Vars::Glow::Backtrack::Blur.Value)
|
||||
&& (F::Backtrack.GetFakeLatency() || F::Backtrack.GetFakeInterp() > G::Lerp || F::Backtrack.GetWindow()))
|
||||
{
|
||||
auto pWeapon = H::Entities.GetWeapon();
|
||||
if (pWeapon && (G::PrimaryWeaponType != EWeaponType::PROJECTILE || Vars::Glow::Backtrack::Draw.Value & Vars::Glow::Backtrack::DrawEnum::Always))
|
||||
|
||||
@@ -75,7 +75,6 @@ void CRadar::DrawBackground()
|
||||
|
||||
void CRadar::DrawPoints(CTFPlayer* pLocal)
|
||||
{
|
||||
// Ammo & Health
|
||||
if (Vars::Radar::World::Enabled.Value)
|
||||
{
|
||||
const int iSize = Vars::Radar::World::Size.Value;
|
||||
@@ -207,7 +206,6 @@ void CRadar::DrawPoints(CTFPlayer* pLocal)
|
||||
}
|
||||
}
|
||||
|
||||
// Draw buildings
|
||||
if (Vars::Radar::Building::Enabled.Value)
|
||||
{
|
||||
const int iSize = Vars::Radar::Building::Size.Value;
|
||||
@@ -276,7 +274,6 @@ void CRadar::DrawPoints(CTFPlayer* pLocal)
|
||||
}
|
||||
}
|
||||
|
||||
// Draw Players
|
||||
if (Vars::Radar::Player::Enabled.Value)
|
||||
{
|
||||
const int iSize = Vars::Radar::Player::Size.Value;
|
||||
|
||||
@@ -350,65 +350,66 @@ void CVisuals::DrawDebugInfo(CTFPlayer* pLocal)
|
||||
{
|
||||
H::Draw.StringOutlined(fFont, x, y += nTall, Vars::Menu::Theme::Active.Value, Vars::Menu::Theme::Background.Value, ALIGN_TOPLEFT, std::format("View: ({:.3f}, {:.3f}, {:.3f})", pCmd->viewangles.x, pCmd->viewangles.y, pCmd->viewangles.z).c_str());
|
||||
H::Draw.StringOutlined(fFont, x, y += nTall, Vars::Menu::Theme::Active.Value, Vars::Menu::Theme::Background.Value, ALIGN_TOPLEFT, std::format("Move: ({}, {}, {})", pCmd->forwardmove, pCmd->sidemove, pCmd->upmove).c_str());
|
||||
|
||||
std::string sButtons = "NONE";
|
||||
if (pCmd->buttons)
|
||||
{
|
||||
static std::vector<std::pair<int, const char*>> vFlags = {
|
||||
PAIR(IN_ATTACK),
|
||||
PAIR(IN_ATTACK2),
|
||||
PAIR(IN_ATTACK3),
|
||||
PAIR(IN_FORWARD),
|
||||
PAIR(IN_BACK),
|
||||
PAIR(IN_MOVELEFT),
|
||||
PAIR(IN_MOVERIGHT),
|
||||
PAIR(IN_JUMP),
|
||||
PAIR(IN_DUCK),
|
||||
PAIR(IN_RELOAD),
|
||||
PAIR(IN_LEFT),
|
||||
PAIR(IN_RIGHT),
|
||||
PAIR(IN_SCORE),
|
||||
/*
|
||||
PAIR(IN_USE),
|
||||
PAIR(IN_CANCEL),
|
||||
PAIR(IN_RUN),
|
||||
PAIR(IN_ALT1),
|
||||
PAIR(IN_ALT2),
|
||||
PAIR(IN_SPEED),
|
||||
PAIR(IN_WALK),
|
||||
PAIR(IN_ZOOM),
|
||||
PAIR(IN_WEAPON1),
|
||||
PAIR(IN_WEAPON2),
|
||||
PAIR(IN_BULLRUSH),
|
||||
PAIR(IN_GRENADE1),
|
||||
PAIR(IN_GRENADE2),
|
||||
*/
|
||||
};
|
||||
|
||||
for (int i = 0; i < vFlags.size(); i++)
|
||||
H::Draw.StringOutlined(fFont, x, y += nTall, Vars::Menu::Theme::Active.Value, Vars::Menu::Theme::Background.Value, ALIGN_TOPLEFT, std::format("Buttons: {:#034b} ({})", pCmd->buttons,
|
||||
[&]()
|
||||
{
|
||||
auto& paFlag = vFlags[i];
|
||||
if (pCmd->buttons & paFlag.first)
|
||||
std::string sReturn = "NONE";
|
||||
if (pCmd->buttons)
|
||||
{
|
||||
if (i)
|
||||
sButtons += " | ";
|
||||
else
|
||||
sButtons = "";
|
||||
sButtons += paFlag.second;
|
||||
static std::vector<std::pair<int, const char*>> vFlags = {
|
||||
PAIR(IN_ATTACK),
|
||||
PAIR(IN_ATTACK2),
|
||||
PAIR(IN_ATTACK3),
|
||||
PAIR(IN_FORWARD),
|
||||
PAIR(IN_BACK),
|
||||
PAIR(IN_MOVELEFT),
|
||||
PAIR(IN_MOVERIGHT),
|
||||
PAIR(IN_JUMP),
|
||||
PAIR(IN_DUCK),
|
||||
PAIR(IN_RELOAD),
|
||||
PAIR(IN_LEFT),
|
||||
PAIR(IN_RIGHT),
|
||||
PAIR(IN_SCORE),
|
||||
/*
|
||||
PAIR(IN_USE),
|
||||
PAIR(IN_CANCEL),
|
||||
PAIR(IN_RUN),
|
||||
PAIR(IN_ALT1),
|
||||
PAIR(IN_ALT2),
|
||||
PAIR(IN_SPEED),
|
||||
PAIR(IN_WALK),
|
||||
PAIR(IN_ZOOM),
|
||||
PAIR(IN_WEAPON1),
|
||||
PAIR(IN_WEAPON2),
|
||||
PAIR(IN_BULLRUSH),
|
||||
PAIR(IN_GRENADE1),
|
||||
PAIR(IN_GRENADE2),
|
||||
*/
|
||||
};
|
||||
|
||||
for (int i = 0; i < vFlags.size(); i++)
|
||||
{
|
||||
auto& paFlag = vFlags[i];
|
||||
if (pCmd->buttons & paFlag.first)
|
||||
{
|
||||
if (i)
|
||||
sReturn += " | ";
|
||||
else
|
||||
sReturn = "";
|
||||
sReturn += paFlag.second;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
H::Draw.StringOutlined(fFont, x, y += nTall, Vars::Menu::Theme::Active.Value, Vars::Menu::Theme::Background.Value, ALIGN_TOPLEFT, std::format("Buttons: {:#034b} ({})", pCmd->buttons, sButtons).c_str());
|
||||
return sReturn;
|
||||
}()
|
||||
).c_str());
|
||||
H::Draw.StringOutlined(fFont, x, y += nTall, Vars::Menu::Theme::Active.Value, Vars::Menu::Theme::Background.Value, ALIGN_TOPLEFT, std::format("Tickcount: {}, Command: {}", pCmd->tick_count, pCmd->command_number).c_str());
|
||||
}
|
||||
{
|
||||
Vec3 vOrigin = pLocal->m_vecOrigin();
|
||||
H::Draw.StringOutlined(fFont, x, y += nTall, Vars::Menu::Theme::Active.Value, Vars::Menu::Theme::Background.Value, ALIGN_TOPLEFT, std::format("Origin: ({:.3f}, {:.3f}, {:.3f})", vOrigin.x, vOrigin.y, vOrigin.z).c_str());
|
||||
}
|
||||
{
|
||||
Vec3 vVelocity = pLocal->m_vecVelocity();
|
||||
H::Draw.StringOutlined(fFont, x, y += nTall, Vars::Menu::Theme::Active.Value, Vars::Menu::Theme::Background.Value, ALIGN_TOPLEFT, std::format("Velocity: {:.3f} ({:.3f}, {:.3f}, {:.3f})", vVelocity.Length(), vVelocity.x, vVelocity.y, vVelocity.z).c_str());
|
||||
}
|
||||
H::Draw.StringOutlined(fFont, x, y += nTall, Vars::Menu::Theme::Active.Value, Vars::Menu::Theme::Background.Value, ALIGN_TOPLEFT, std::format("Tickcount: {}", pLocal->m_nTickBase()).c_str());
|
||||
Vec3 vOrigin = pLocal->m_vecOrigin();
|
||||
H::Draw.StringOutlined(fFont, x, y += nTall * 2, Vars::Menu::Theme::Active.Value, Vars::Menu::Theme::Background.Value, ALIGN_TOPLEFT, std::format("Origin: ({:.3f}, {:.3f}, {:.3f})", vOrigin.x, vOrigin.y, vOrigin.z).c_str());
|
||||
Vec3 vVelocity = pLocal->m_vecVelocity();
|
||||
H::Draw.StringOutlined(fFont, x, y += nTall, Vars::Menu::Theme::Active.Value, Vars::Menu::Theme::Background.Value, ALIGN_TOPLEFT, std::format("Velocity: {:.3f} ({:.3f}, {:.3f}, {:.3f})", vVelocity.Length(), vVelocity.x, vVelocity.y, vVelocity.z).c_str());
|
||||
H::Draw.StringOutlined(fFont, x, y += nTall, Vars::Menu::Theme::Active.Value, Vars::Menu::Theme::Background.Value, ALIGN_TOPLEFT, std::format("Tickbase: {}", pLocal->m_nTickBase()).c_str());
|
||||
//H::Draw.StringOutlined(fFont, x, y += nTall, Vars::Menu::Theme::Active.Value, Vars::Menu::Theme::Background.Value, ALIGN_TOPLEFT, std::format("Choke: {}, {}", G::Choking, I::ClientState->chokedcommands).c_str());
|
||||
//H::Draw.StringOutlined(fFont, x, y += nTall, Vars::Menu::Theme::Active.Value, Vars::Menu::Theme::Background.Value, ALIGN_TOPLEFT, std::format("Ticks: {}, {}", F::Ticks.m_iShiftedTicks, F::Ticks.m_iShiftedGoal).c_str());
|
||||
//H::Draw.StringOutlined(fFont, x, y += nTall, Vars::Menu::Theme::Active.Value, Vars::Menu::Theme::Background.Value, ALIGN_TOPLEFT, std::format("Round state: {}, {}, {}", SDK::GetRoundState(), SDK::GetWinningTeam(), I::EngineClient->IsPlayingDemo()).c_str());
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
MAKE_SIGNATURE(CAttributeManager_AttribHookInt, "client.dll", "4C 8B DC 49 89 5B ? 49 89 6B ? 49 89 73 ? 57 41 54 41 55 41 56 41 57 48 83 EC ? 48 8B 3D ? ? ? ? 4C 8D 35", 0x0);
|
||||
MAKE_SIGNATURE(CTFPlayer_FireEvent_AttribHookValue_Call, "client.dll", "8B F8 83 BE", 0x0);
|
||||
|
||||
static int ColorToInt(const Color_t& col)
|
||||
static inline int ColorToInt(const Color_t& col)
|
||||
{
|
||||
return col.r << 16 | col.g << 8 | col.b;
|
||||
}
|
||||
|
||||
@@ -27,8 +27,8 @@ MAKE_HOOK(CNetChannel_SendNetMsg, S::CNetChannel_SendNetMsg(), bool,
|
||||
switch (FNV1A::Hash32(localCvar->Name))
|
||||
{
|
||||
case FNV1A::Hash32Const("cl_interp"):
|
||||
if (F::Backtrack.m_flWishInterp != -1.f)
|
||||
strncpy_s(localCvar->Value, std::to_string(F::Backtrack.m_flWishInterp).c_str(), MAX_OSPATH);
|
||||
if (F::Backtrack.m_flSentInterp != -1.f)
|
||||
strncpy_s(localCvar->Value, std::to_string(F::Backtrack.m_flSentInterp).c_str(), MAX_OSPATH);
|
||||
if (Vars::Misc::Game::AntiCheatCompatibility.Value)
|
||||
{ try {
|
||||
float flValue = std::stof(localCvar->Value);
|
||||
@@ -88,8 +88,8 @@ MAKE_HOOK(CNetChannel_SendNetMsg, S::CNetChannel_SendNetMsg(), bool,
|
||||
switch (FNV1A::Hash32(cvarName))
|
||||
{
|
||||
case FNV1A::Hash32Const("cl_interp"):
|
||||
if (F::Backtrack.m_flWishInterp != -1.f)
|
||||
sValue = std::to_string(std::min(F::Backtrack.m_flWishInterp, 0.1f));
|
||||
if (F::Backtrack.m_flSentInterp != -1.f)
|
||||
sValue = std::to_string(std::min(F::Backtrack.m_flSentInterp, 0.1f));
|
||||
else
|
||||
sValue = pConVar->GetString();
|
||||
break;
|
||||
|
||||
@@ -10,7 +10,7 @@ MAKE_SIGNATURE(CTFHudMatchStatus_UpdatePlayerAvatar, "client.dll", "4D 85 C0 0F
|
||||
MAKE_SIGNATURE(SectionedListPanel_SetItemFgColor, "client.dll", "40 53 48 83 EC ? 48 8B D9 3B 91 ? ? ? ? 73 ? 3B 91 ? ? ? ? 7F ? 48 8B 89 ? ? ? ? 48 89 7C 24 ? 8B FA 48 03 FF 39 54 F9 ? 75 ? 39 54 F9 ? 75 ? 48 8B 0C F9 41 8B D0 48 8B 01 FF 90 ? ? ? ? 48 8B 83 ? ? ? ? B2 ? 48 8B 0C F8 48 8B 01 FF 90 ? ? ? ? 48 8B 83 ? ? ? ? 45 33 C0", 0x0);
|
||||
MAKE_SIGNATURE(CTFClientScoreBoardDialog_UpdatePlayerList_SetItemFgColor_Call, "client.dll", "49 8B 04 24 8B D5 C7 44 24", 0x0);
|
||||
|
||||
static int CTFClientScoreBoardDialog_UpdatePlayerList_PlayerIndex;
|
||||
static int iPlayerIndex;
|
||||
|
||||
MAKE_HOOK(CTFClientScoreBoardDialog_UpdatePlayerAvatar, S::CTFClientScoreBoardDialog_UpdatePlayerAvatar(), void,
|
||||
void* rcx, int playerIndex, KeyValues* kv)
|
||||
@@ -20,7 +20,7 @@ MAKE_HOOK(CTFClientScoreBoardDialog_UpdatePlayerAvatar, S::CTFClientScoreBoardDi
|
||||
return CALL_ORIGINAL(rcx, playerIndex, kv);
|
||||
#endif
|
||||
|
||||
CTFClientScoreBoardDialog_UpdatePlayerList_PlayerIndex = playerIndex;
|
||||
iPlayerIndex = playerIndex;
|
||||
|
||||
int iType = 0; F::PlayerUtils.GetPlayerName(playerIndex, nullptr, &iType);
|
||||
if (iType != 1)
|
||||
@@ -79,11 +79,11 @@ MAKE_HOOK(SectionedListPanel_SetItemFgColor, S::SectionedListPanel_SetItemFgColo
|
||||
|
||||
if (dwDesired == dwRetAddr && Vars::Visuals::UI::ScoreboardColors.Value)
|
||||
{
|
||||
Color_t tColor = H::Color.GetScoreboardColor(CTFClientScoreBoardDialog_UpdatePlayerList_PlayerIndex);
|
||||
Color_t tColor = H::Color.GetScoreboardColor(iPlayerIndex);
|
||||
if (tColor.a)
|
||||
{
|
||||
auto pResource = H::Entities.GetPR();
|
||||
if (pResource && !pResource->m_bAlive(CTFClientScoreBoardDialog_UpdatePlayerList_PlayerIndex))
|
||||
if (pResource && !pResource->m_bAlive(iPlayerIndex))
|
||||
tColor = tColor.Lerp({ 127, 127, 127, tColor.a }, 0.5f);
|
||||
|
||||
color = tColor;
|
||||
|
||||
@@ -8,6 +8,8 @@ MAKE_SIGNATURE(vgui_Panel_SetBgColor, "client.dll", "89 91 ? ? ? ? C3 CC CC CC C
|
||||
MAKE_SIGNATURE(CTFTeamStatusPlayerPanel_Update_GetTeam_Call, "client.dll", "8B 9F ? ? ? ? 40 32 F6", 0x0);
|
||||
MAKE_SIGNATURE(CTFTeamStatusPlayerPanel_Update_SetBgColor_Call, "client.dll", "48 8B 8F ? ? ? ? 4C 8B 6C 24 ? 48 85 C9 0F 84 ? ? ? ? 40 38 B7", 0x0);
|
||||
|
||||
static int iPlayerIndex;
|
||||
|
||||
MAKE_HOOK(CTFPlayerPanel_GetTeam, S::CTFPlayerPanel_GetTeam(), int,
|
||||
void* rcx)
|
||||
{
|
||||
@@ -28,8 +30,6 @@ MAKE_HOOK(CTFPlayerPanel_GetTeam, S::CTFPlayerPanel_GetTeam(), int,
|
||||
return CALL_ORIGINAL(rcx);
|
||||
}
|
||||
|
||||
static int CTFTeamStatusPlayerPanel_Update_PlayerIndex;
|
||||
|
||||
MAKE_HOOK(CTFTeamStatusPlayerPanel_Update, S::CTFTeamStatusPlayerPanel_Update(), bool,
|
||||
void* rcx)
|
||||
{
|
||||
@@ -38,7 +38,7 @@ MAKE_HOOK(CTFTeamStatusPlayerPanel_Update, S::CTFTeamStatusPlayerPanel_Update(),
|
||||
return CALL_ORIGINAL(rcx);
|
||||
#endif
|
||||
|
||||
CTFTeamStatusPlayerPanel_Update_PlayerIndex = *reinterpret_cast<int*>(uintptr_t(rcx) + 580);
|
||||
iPlayerIndex = *reinterpret_cast<int*>(uintptr_t(rcx) + 580);
|
||||
return CALL_ORIGINAL(rcx);
|
||||
}
|
||||
|
||||
@@ -55,11 +55,11 @@ MAKE_HOOK(vgui_Panel_SetBgColor, S::vgui_Panel_SetBgColor(), void,
|
||||
|
||||
if (dwRetAddr == dwDesired && Vars::Visuals::UI::ScoreboardColors.Value)
|
||||
{
|
||||
Color_t tColor = H::Color.GetScoreboardColor(CTFTeamStatusPlayerPanel_Update_PlayerIndex);
|
||||
Color_t tColor = H::Color.GetScoreboardColor(iPlayerIndex);
|
||||
if (tColor.a)
|
||||
{
|
||||
auto pResource = H::Entities.GetPR();
|
||||
if (pResource && !pResource->m_bAlive(CTFTeamStatusPlayerPanel_Update_PlayerIndex))
|
||||
if (pResource && !pResource->m_bAlive(iPlayerIndex))
|
||||
tColor = tColor.Lerp({ 127, 127, 127, tColor.a }, 0.5f);
|
||||
|
||||
color = tColor;
|
||||
|
||||
@@ -10,9 +10,9 @@ MAKE_SIGNATURE(CTFClientScoreBoardDialog_OnCommand, "client.dll", "48 89 5C 24 ?
|
||||
MAKE_SIGNATURE(CTFClientScoreBoardDialog_OnScoreBoardMouseRightRelease_IsPlayerBlocked_Call, "client.dll", "84 C0 48 8D 0D ? ? ? ? 48 8D 15 ? ? ? ? 48 0F 45 D1 4C 8D 0D", 0x0);
|
||||
MAKE_SIGNATURE(CTFClientScoreBoardDialog_OnScoreBoardMouseRightRelease_AddMenuItem_Call, "client.dll", "48 8B 0D ? ? ? ? 4C 8D 85 ? ? ? ? 48 8D 95 ? ? ? ? 48 8B 01 FF 90 ? ? ? ? 44 8B 85", 0x0);
|
||||
|
||||
static int PlayerIndex;
|
||||
static uint32_t FriendsID;
|
||||
static std::string PlayerName;
|
||||
static int iPlayerIndex;
|
||||
static uint32_t uFriendsID;
|
||||
static std::string sPlayerName;
|
||||
|
||||
MAKE_HOOK(CVoiceStatus_IsPlayerBlocked, S::CVoiceStatus_IsPlayerBlocked(), bool,
|
||||
void* rcx, int playerIndex)
|
||||
@@ -26,7 +26,7 @@ MAKE_HOOK(CVoiceStatus_IsPlayerBlocked, S::CVoiceStatus_IsPlayerBlocked(), bool,
|
||||
const auto dwRetAddr = uintptr_t(_ReturnAddress());
|
||||
|
||||
if (Vars::Visuals::UI::ScoreboardUtility.Value && dwRetAddr == dwDesired)
|
||||
PlayerIndex = playerIndex;
|
||||
iPlayerIndex = playerIndex;
|
||||
|
||||
return CALL_ORIGINAL(rcx, playerIndex);
|
||||
}
|
||||
@@ -42,20 +42,20 @@ MAKE_HOOK(VGuiMenuBuilder_AddMenuItem, S::VGuiMenuBuilder_AddMenuItem(), void*,
|
||||
static const auto dwDesired = S::CTFClientScoreBoardDialog_OnScoreBoardMouseRightRelease_AddMenuItem_Call();
|
||||
const auto dwRetAddr = uintptr_t(_ReturnAddress());
|
||||
|
||||
if (Vars::Visuals::UI::ScoreboardUtility.Value && dwRetAddr == dwDesired && PlayerIndex != -1)
|
||||
if (Vars::Visuals::UI::ScoreboardUtility.Value && dwRetAddr == dwDesired && iPlayerIndex != -1)
|
||||
{
|
||||
auto ret = CALL_ORIGINAL(rcx, pszButtonText, pszCommand, pszCategoryName);
|
||||
|
||||
PlayerInfo_t pi{};
|
||||
if (I::EngineClient->GetPlayerInfo(PlayerIndex, &pi) && !pi.fakeplayer)
|
||||
if (I::EngineClient->GetPlayerInfo(iPlayerIndex, &pi) && !pi.fakeplayer)
|
||||
{
|
||||
FriendsID = pi.friendsID;
|
||||
PlayerName = pi.name;
|
||||
uFriendsID = pi.friendsID;
|
||||
sPlayerName = pi.name;
|
||||
|
||||
CALL_ORIGINAL(rcx, "History", "history", "profile");
|
||||
CALL_ORIGINAL(rcx, I::EngineClient->GetPlayerForUserID(F::Spectate.m_iIntendedTarget) == PlayerIndex ? "Unspectate" : "Spectate", "spectate", "profile");
|
||||
CALL_ORIGINAL(rcx, I::EngineClient->GetPlayerForUserID(F::Spectate.m_iIntendedTarget) == iPlayerIndex ? "Unspectate" : "Spectate", "spectate", "profile");
|
||||
|
||||
CALL_ORIGINAL(rcx, std::format("Tags for {}", PlayerName).c_str(), "listtags", "tags");
|
||||
CALL_ORIGINAL(rcx, std::format("Tags for {}", sPlayerName).c_str(), "listtags", "tags");
|
||||
for (auto it = F::PlayerUtils.m_vTags.begin(); it != F::PlayerUtils.m_vTags.end(); it++)
|
||||
{
|
||||
int iID = std::distance(F::PlayerUtils.m_vTags.begin(), it);
|
||||
@@ -63,7 +63,7 @@ MAKE_HOOK(VGuiMenuBuilder_AddMenuItem, S::VGuiMenuBuilder_AddMenuItem(), void*,
|
||||
if (!tTag.m_bAssignable)
|
||||
continue;
|
||||
|
||||
bool bHasTag = F::PlayerUtils.HasTag(FriendsID, iID);
|
||||
bool bHasTag = F::PlayerUtils.HasTag(uFriendsID, iID);
|
||||
CALL_ORIGINAL(rcx, std::format("{} {}", bHasTag ? "Remove" : "Add", tTag.m_sName).c_str(), std::format("modifytag{}", iID).c_str(), "tags");
|
||||
}
|
||||
}
|
||||
@@ -89,14 +89,14 @@ MAKE_HOOK(CTFClientScoreBoardDialog_OnCommand, S::CTFClientScoreBoardDialog_OnCo
|
||||
switch (uHash)
|
||||
{
|
||||
case FNV1A::Hash32Const("history"):
|
||||
I::SteamFriends->ActivateGameOverlayToWebPage(std::format("https://steamhistory.net/id/{}", CSteamID(FriendsID, k_EUniversePublic, k_EAccountTypeIndividual).ConvertToUint64()).c_str());
|
||||
I::SteamFriends->ActivateGameOverlayToWebPage(std::format("https://steamhistory.net/id/{}", CSteamID(uFriendsID, k_EUniversePublic, k_EAccountTypeIndividual).ConvertToUint64()).c_str());
|
||||
break;
|
||||
case FNV1A::Hash32Const("spectate"):
|
||||
if (auto pResource = H::Entities.GetPR())
|
||||
F::Spectate.SetTarget(pResource->m_iUserID(PlayerIndex));
|
||||
F::Spectate.SetTarget(pResource->m_iUserID(iPlayerIndex));
|
||||
break;
|
||||
case FNV1A::Hash32Const("listtags"):
|
||||
F::Output.TagsOnJoin(PlayerName, FriendsID);
|
||||
F::Output.TagsOnJoin(sPlayerName, uFriendsID);
|
||||
break;
|
||||
default:
|
||||
if (strstr(command, "modifytag"))
|
||||
@@ -106,10 +106,10 @@ MAKE_HOOK(CTFClientScoreBoardDialog_OnCommand, S::CTFClientScoreBoardDialog_OnCo
|
||||
std::string sTag = command;
|
||||
sTag = sTag.replace(0, strlen("modifytag"), "");
|
||||
int iID = std::stoi(sTag);
|
||||
if (!F::PlayerUtils.HasTag(FriendsID, iID))
|
||||
F::PlayerUtils.AddTag(FriendsID, iID, true, PlayerName);
|
||||
if (!F::PlayerUtils.HasTag(uFriendsID, iID))
|
||||
F::PlayerUtils.AddTag(uFriendsID, iID, true, sPlayerName);
|
||||
else
|
||||
F::PlayerUtils.RemoveTag(FriendsID, iID, true, PlayerName);
|
||||
F::PlayerUtils.RemoveTag(uFriendsID, iID, true, sPlayerName);
|
||||
}
|
||||
catch (...) {}
|
||||
}
|
||||
|
||||
@@ -424,51 +424,51 @@ void CDraw::DrawHudTextureByName(float x, float y, float s, const char* sTexture
|
||||
|
||||
void CDraw::Avatar(int x, int y, int w, int h, const uint32 nFriendID, const EAlign& eAlign)
|
||||
{
|
||||
if (const auto nID = static_cast<uint64>(nFriendID + 0x0110000100000000))
|
||||
if (!nFriendID)
|
||||
return;
|
||||
|
||||
switch (eAlign)
|
||||
{
|
||||
switch (eAlign)
|
||||
case ALIGN_TOPLEFT: break;
|
||||
case ALIGN_TOP: x -= w / 2; break;
|
||||
case ALIGN_TOPRIGHT: x -= w; break;
|
||||
case ALIGN_LEFT: y -= h / 2; break;
|
||||
case ALIGN_CENTER: x -= w / 2; y -= h / 2; break;
|
||||
case ALIGN_RIGHT: x -= w; y -= h / 2; break;
|
||||
case ALIGN_BOTTOMLEFT: y -= h; break;
|
||||
case ALIGN_BOTTOM: x -= w / 2; y -= h; break;
|
||||
case ALIGN_BOTTOMRIGHT: x -= w; y -= h; break;
|
||||
}
|
||||
|
||||
if (m_mAvatars.contains(nFriendID))
|
||||
{
|
||||
I::MatSystemSurface->DrawSetColor(255, 255, 255, 255);
|
||||
I::MatSystemSurface->DrawSetTexture(m_mAvatars[nFriendID]);
|
||||
I::MatSystemSurface->DrawTexturedRect(x, y, x + w, y + h);
|
||||
}
|
||||
else
|
||||
{
|
||||
const int nAvatar = I::SteamFriends->GetMediumFriendAvatar(CSteamID(nFriendID, k_EUniversePublic, k_EAccountTypeIndividual));
|
||||
|
||||
uint32 newW = 0, newH = 0;
|
||||
if (I::SteamUtils->GetImageSize(nAvatar, &newW, &newH))
|
||||
{
|
||||
case ALIGN_TOPLEFT: break;
|
||||
case ALIGN_TOP: x -= w / 2; break;
|
||||
case ALIGN_TOPRIGHT: x -= w; break;
|
||||
case ALIGN_LEFT: y -= h / 2; break;
|
||||
case ALIGN_CENTER: x -= w / 2; y -= h / 2; break;
|
||||
case ALIGN_RIGHT: x -= w; y -= h / 2; break;
|
||||
case ALIGN_BOTTOMLEFT: y -= h; break;
|
||||
case ALIGN_BOTTOM: x -= w / 2; y -= h; break;
|
||||
case ALIGN_BOTTOMRIGHT: x -= w; y -= h; break;
|
||||
}
|
||||
const uint32 nSize = newW * newH * uint32(sizeof(uint8) * 4);
|
||||
auto* pData = static_cast<uint8*>(std::malloc(nSize));
|
||||
if (!pData)
|
||||
return;
|
||||
|
||||
if (m_mAvatars.contains(nID))
|
||||
{ // The avatar has been cached
|
||||
I::MatSystemSurface->DrawSetColor(255, 255, 255, 255);
|
||||
I::MatSystemSurface->DrawSetTexture(m_mAvatars[nID]);
|
||||
I::MatSystemSurface->DrawTexturedRect(x, y, x + w, y + h);
|
||||
}
|
||||
else
|
||||
{ // Retrieve the avatar
|
||||
const int nAvatar = I::SteamFriends->GetMediumFriendAvatar(CSteamID(nID));
|
||||
|
||||
uint32 newW = 0, newH = 0;
|
||||
if (I::SteamUtils->GetImageSize(nAvatar, &newW, &newH))
|
||||
if (I::SteamUtils->GetImageRGBA(nAvatar, pData, nSize))
|
||||
{
|
||||
const uint32 nSize = newW * newH * uint32(sizeof(uint8) * 4);
|
||||
auto* pData = static_cast<uint8*>(std::malloc(nSize));
|
||||
if (!pData)
|
||||
return;
|
||||
|
||||
if (I::SteamUtils->GetImageRGBA(nAvatar, pData, nSize))
|
||||
const int nTextureID = I::MatSystemSurface->CreateNewTextureID(true);
|
||||
if (I::MatSystemSurface->IsTextureIDValid(nTextureID))
|
||||
{
|
||||
const int nTextureID = I::MatSystemSurface->CreateNewTextureID(true);
|
||||
if (I::MatSystemSurface->IsTextureIDValid(nTextureID))
|
||||
{
|
||||
I::MatSystemSurface->DrawSetTextureRGBA(nTextureID, pData, newW, newH, 0, false);
|
||||
m_mAvatars[nID] = nTextureID;
|
||||
}
|
||||
I::MatSystemSurface->DrawSetTextureRGBA(nTextureID, pData, newW, newH, 0, false);
|
||||
m_mAvatars[nFriendID] = nTextureID;
|
||||
}
|
||||
|
||||
std::free(pData);
|
||||
}
|
||||
|
||||
std::free(pData);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ enum Scale_
|
||||
|
||||
class CDraw
|
||||
{
|
||||
std::unordered_map<uint64, int> m_mAvatars = {};
|
||||
std::unordered_map<uint32, int> m_mAvatars = {};
|
||||
|
||||
public:
|
||||
inline bool IsColorBright(const Color_t& clr)
|
||||
|
||||
@@ -156,6 +156,8 @@ void CEntities::Store()
|
||||
std::unordered_map<uint32_t, int> mLevels = {};
|
||||
if (bUpdateInfo)
|
||||
{
|
||||
m_mIPriorities.clear();
|
||||
m_mUPriorities.clear();
|
||||
m_mIFriends.clear();
|
||||
m_mUFriends.clear();
|
||||
m_mIParty.clear();
|
||||
@@ -164,8 +166,6 @@ void CEntities::Store()
|
||||
m_mUF2P.clear();
|
||||
m_mILevels.clear();
|
||||
m_mULevels.clear();
|
||||
m_mIPriorities.clear();
|
||||
m_mUPriorities.clear();
|
||||
|
||||
if (auto pLobby = I::TFGCClientSystem->GetLobby())
|
||||
{
|
||||
@@ -204,6 +204,7 @@ void CEntities::Store()
|
||||
{
|
||||
bool bLocal = n == I::EngineClient->GetLocalPlayer();
|
||||
if (bLocal) m_uFriendsID = pi.friendsID;
|
||||
|
||||
m_mIPriorities[n] = m_mUPriorities[pi.friendsID] = !bLocal ? F::PlayerUtils.GetPriority(pi.friendsID, false) : 0;
|
||||
m_mIFriends[n] = m_mUFriends[pi.friendsID] = I::SteamFriends->HasFriend({ pi.friendsID, 1, k_EUniversePublic, k_EAccountTypeIndividual }, k_EFriendFlagImmediate);
|
||||
m_mIParty[n] = m_mUParty[pi.friendsID] = mParties.contains(pi.friendsID) ? mParties[pi.friendsID] : 0;
|
||||
@@ -326,19 +327,23 @@ void CEntities::Clear(bool bShutdown)
|
||||
m_pLocalWeapon = nullptr;
|
||||
m_pPlayerResource = nullptr;
|
||||
m_mGroups.clear();
|
||||
m_bSettingUpBones = false;
|
||||
|
||||
if (bShutdown)
|
||||
{
|
||||
m_mSimTimes.clear();
|
||||
m_mOldSimTimes.clear();
|
||||
m_mDeltaTimes.clear();
|
||||
m_mLagTimes.clear();
|
||||
m_mChokes.clear();
|
||||
m_mDormancy.clear();
|
||||
m_mSetTicks.clear();
|
||||
m_mBones.clear();
|
||||
m_mEyeAngles.clear();
|
||||
m_mOldAngles.clear();
|
||||
m_mEyeAngles.clear();
|
||||
m_mLagCompensation.clear();
|
||||
m_mDormancy.clear();
|
||||
m_mAvgVelocities.clear();
|
||||
m_mModels.clear();
|
||||
m_mOrigins.clear();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user