Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int AntiAim::LBYUpdate()
- {
- static int choked = 0;
- static bool wasMoving = true;
- static bool firstBreak = false;
- static bool preBreak = false;
- static bool shouldBreak = false;
- static bool brokeThisTick = false;
- static bool preBreakNeeded = true;
- static float lastLBY = 0;
- double curtime = g_GlobalVars->curtime; //AimRage::Get().GetTickbase() * g_GlobalVars->interval_per_tick;
- bool bIsMoving = false;
- //if (checks::is_bad_ptr(Animation::Get().GetPlayerAnimationInfo(g_LocalPlayer->EntIndex()).m_playerAnimState))
- //use anim state velocity for more accurate result
- //bIsMoving = Animation::Get().GetPlayerAnimationInfo(g_LocalPlayer->EntIndex()).m_playerAnimState->m_flVelocity() >= 0.1f;
- bIsMoving = g_LocalPlayer->GetPlayerAnimState()->m_flVelocity() >= 0.1f;
- auto nci = g_EngineClient->GetNetChannelInfo();
- if (g_LocalPlayer->m_flLowerBodyYawTarget() != lastLBY)
- {
- Global::LastLBYUpdate = curtime;
- lastLBY = g_LocalPlayer->m_flLowerBodyYawTarget();
- }
- if (Global::bSendPacket)
- {
- brokeThisTick = false;
- choked = g_ClientState->chokedcommands - Global::prevchoked;
- if (bIsMoving && (g_LocalPlayer->m_fFlags() & FL_ONGROUND) && !(g_InputSystem->IsButtonDown(g_Options.misc_fakewalk_bind) && g_Options.misc_fakewalk))
- {
- m_flNextBodyUpdate = curtime + 0.22;
- Global::NextLBYUpdate = curtime + 0.22;
- wasMoving = true;
- firstBreak = true;
- }
- else
- {
- if (wasMoving && curtime - Global::LastLBYUpdate >= 0.22)
- {
- wasMoving = false;
- firstBreak = false;
- shouldBreak = true;
- m_flNextBodyUpdate = curtime + 1.1;
- Global::NextLBYUpdate = curtime + 1.1;
- }
- else if (curtime - Global::LastLBYUpdate >= 1.1 - TICKS_TO_TIME(choked))
- {
- shouldBreak = true;
- firstBreak = false;
- m_flNextBodyUpdate = curtime + 1.1;
- Global::NextLBYUpdate = curtime + 1.1;
- }
- else if (curtime - Global::LastLBYUpdate >= 1.1 - (TICKS_TO_TIME(choked) + g_GlobalVars->interval_per_tick * 2) && !firstBreak)
- {
- preBreak = true;
- }
- /*
- else if (abs(Math::ClampYaw(oldlby - g_LocalPlayer->m_flLowerBodyYawTarget())) > 1 && abs(Math::ClampYaw(m_flLowerBodyTarget - g_LocalPlayer->m_flLowerBodyYawTarget())) > 10)
- {
- m_flNextBodyUpdate = server_time + g_GlobalVars->interval_per_tick + 1.1;
- oldCurtime = server_time + nci->GetLatency(FLOW_INCOMING);
- //if (abs(Math::ClampYaw(target_pre - g_LocalPlayer->m_flLowerBodyYawTarget())) < 1) oldCurtime += pre_delay;
- m_flNextBodyUpdate = server_time + 1.1;
- firstBreak = true;
- }
- */
- }
- }
- else
- {
- static float last_last_update = 0;
- if (preBreak)
- {
- preBreak = false;
- return 2;
- }
- else if (shouldBreak)
- {
- shouldBreak = false;
- Global::LastLBYUpdate = curtime;
- last_last_update = curtime;
- preBreakNeeded = true;
- return 1;
- }
- else
- {
- if (Global::LastLBYUpdate != last_last_update && abs(Global::LastLBYUpdate - last_last_update) < 1.f)
- {
- firstBreak = true;
- last_last_update = Global::LastLBYUpdate;
- }
- else if (abs(Math::ClampYaw(GetYaw() - g_LocalPlayer->m_flLowerBodyYawTarget())) < 50)
- {
- preBreakNeeded = false;
- }
- return 0;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement