CSGO: LBY breaker not breaking all the time
void LowerBodyBreakerTest(CUserCmd* cmd, bool& bSendPacket)
{
static bool Update = true;
static float LastLBYUpdateTime = 0;
float server_time = g_LocalPlayer->m_nTickBase() * g_GlobalVars->interval_per_tick;
//Checks if LBY Updated
if (LastLBY != g_LocalPlayer->m_flLowerBodyYawTarget())
{
LastLBYUpdateTime = server_time;
LastLBY = g_LocalPlayer->m_flLowerBodyYawTarget();
}
//Checks if LBY will update or not
if (LastLBYUpdateTime + 1.1 - OutgoingLatency() < server_time)
{
Update = true;
LastLBYUpdateTime += 1.1;
}
else
Update = false;
QAngle Fake;
QAngle Real;
Real.yaw = g_LocalPlayer->m_flLowerBodyYawTarget() + 180.f; //+90
Fake.yaw = g_LocalPlayer->m_flLowerBodyYawTarget();
//pitch stuff
//REVERSED MOVEMENT BULLSHIT
if (g_LocalPlayer->m_vecVelocity().Length2D() > 0.1)Real = Fake;
//If LBY updates, sets angle back to LBY
if (Update)
{
Real.yaw = g_LocalPlayer->m_flLowerBodyYawTarget() + flrand(-10.f, 10.f);
bSendPacket = true;
cmd->viewangles = Real;
return;
}
//if LBY doesn't update, sets fake & real angles
else
{
if (cPackets < 10)
{
cmd->viewangles = Real;
bSendPacket = false;
cPackets++;
}
else
{
cmd->viewangles = Fake;
bSendPacket = true;
cPackets = 0;
}
}
}
So this is working on my local server. But if I go to a HVH server, sometimes LBY just keeps flipping with its inverse. And it’s annyoing, since it’s not breaking it.
I’ve been struggling with this issue for a day now, and I can’t resolve it :/
I tried commenting my code for better understanding tho.
|