mirror of
https://github.com/rei-2/Amalgam
synced 2026-10-10 21:03:09 +08:00
fix feet yaw/animation issue
This commit is contained in:
@@ -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();
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user