fix feet yaw/animation issue

This commit is contained in:
rei-2
2024-10-29 11:30:24 -04:00
parent 9e5a7d67f3
commit cc9d19dca4
3 changed files with 20 additions and 21 deletions
@@ -145,11 +145,29 @@ MAKE_HOOK(CClientModeShared_CreateMove, U::Memory.GetVFunc(I::ClientModeShared,
}
F::Ticks.ManagePacket(pCmd, pSendPacket);
F::AntiAim.Run(pLocal, pWeapon, pCmd, *pSendPacket);
G::Choking = !*pSendPacket;
if (*pSendPacket)
F::FakeAngle.Run(pLocal);
G::ViewAngles = pCmd->viewangles;
if (pLocal)
{
static std::vector<Vec3> vAngles;
vAngles.push_back(pCmd->viewangles);
auto pAnimState = pLocal->GetAnimState();
if (pAnimState && *pSendPacket)
{
float flOldFrametime = I::GlobalVars->frametime;
I::GlobalVars->frametime = TICK_INTERVAL;
for (auto& vAngle : vAngles)
{
pAnimState->Update(vAngle.y, vAngle.x);
pLocal->FrameAdvance(TICK_INTERVAL);
}
I::GlobalVars->frametime = flOldFrametime;
vAngles.clear();
}
}
G::Choking = !*pSendPacket;
G::LastUserCmd = pCmd;
//const bool bShouldSkip = G::PSilentAngles || G::SilentAngles || G::AntiAim || G::AvoidingBackstab;
@@ -2,28 +2,10 @@
#include "../Features/EnginePrediction/EnginePrediction.h"
static std::vector<Vec3> vAngles;
MAKE_HOOK(CPrediction_RunCommand, U::Memory.GetVFunc(I::Prediction, 17), void, __fastcall,
void* rcx, CTFPlayer* pPlayer, CUserCmd* pCmd, IMoveHelper* pMoveHelper)
{
F::EnginePrediction.ScalePlayers(H::Entities.GetLocal());
CALL_ORIGINAL(rcx, pPlayer, pCmd, pMoveHelper);
F::EnginePrediction.RestorePlayers();
// credits: KGB
if (pCmd->hasbeenpredicted || G::Recharge)
return;
auto pAnimState = pPlayer->GetAnimState();
vAngles.push_back(G::ViewAngles);
if (!pAnimState || G::Choking)
return;
for (auto& vAngle : vAngles)
{
pAnimState->Update(vAngle.y, vAngle.x);
pPlayer->FrameAdvance(TICK_INTERVAL);
}
vAngles.clear();
}
-1
View File
@@ -61,7 +61,6 @@ namespace G
inline std::pair<int, int> Target = { 0, 0 };
inline Vec3 AimPosition = {};
inline Vec3 ViewAngles = {};
inline bool SilentAngles = false;
inline bool PSilentAngles = false;