void F::ANTIAIM::RunAA(CUserCmd* pCmd, CBaseUserCmdPB* pUserCmd, C_CSPlayerPawn* pLocalPawn)
{
if (!C_GET(bool, Vars.bAntiaim))
return;
if (pCmd == nullptr || pUserCmd == nullptr || pUserCmd->pViewAngles == nullptr)
return;
if (!pLocalPawn->IsValidMoveType())
return;
if (pCmd->nButtons.nValue & IN_USE || pCmd->nButtons.nValue & IN_ATTACK)
return;
auto active_weapon = H::cheat->m_weapon;
if (active_weapon == nullptr)
return;
auto pWeaponVData = H::cheat->m_wpn_data;
if (pWeaponVData == nullptr)
return;
if (pWeaponVData->GetWeaponType() == WEAPONTYPE_GRENADE)
{
auto Grenade = I::GameResourceService->pGameEntitySystem->Get<C_BaseCSGrenade>(active_weapon->GetRefEHandle());
if (Grenade)
{
if (Grenade->GetThrowTime() > 0)
return;
}
}
if (pCmd->nButtons.nValue & IN_ATTACK)
{
return;
}
float flPitch = 0;
float flYaw = pCmd->csgoUserCmd.pBaseCmd->pViewAngles->angValue.y;
if (C_GET(int, Vars.iAntiaimPitch) == AA_UP)
flPitch = -2182423346297399750336966557899.f;
if (C_GET(int, Vars.iAntiaimPitch) == AA_DOWN)
flPitch = 89.f;
if (C_GET(int, Vars.iAntiaimPitch) == AA_CENTER)
flPitch = 0;
if (C_GET(bool, Vars.bAntiaimYaw))
flYaw -= 180.0f;
pUserCmd->pViewAngles->angValue.x = flPitch;
pUserCmd->pViewAngles->angValue.y = flYaw;