Исходник Resolver

Пользователь
Статус
Оффлайн
Регистрация
8 Янв 2020
Сообщения
187
Реакции[?]
138
Поинты[?]
20K
Animation fix and resolver.
C++:
struct CLocalData
{
    bool m_bSendPacket;
    bool m_bMatrix;
    bool m_bUpdateFakeAnimation;
    bool m_bInitFakeAnimation;

    float m_flSpawnTime;
    float* m_flBackupPoseParameter;

    Vector m_angViewAngles;
    Vector m_BackupAbsAngles;

    matrix3x4_t m_pFakeMatrix[128];

    C_AnimState* m_aFakeAnimationState;
    AnimationLayer m_aServerLayers[13];
};

struct CResolverData
{
    float m_flRightAbsYaw;
    float m_flLeftAbsYaw;
    float m_flFeetDelta;
    float m_flDuckAmount;
    float m_nSpeed;
    float m_pfGuessedAngle;

    int m_nChoked;
    int m_iSide;

    AnimationLayer m_aServerLayers[13];
    AnimationLayer m_aResolverLayers[3][13];

    C_AnimState* m_aAnimationState;

    Vector m_angEyeAngles;

    bool m_bLeftDormancy;
    bool m_bInAir;
};

struct CAnimationData
{
    float m_flRightAngle;
    float m_flMiddleAngle;
    float m_flLeftAngle;
};

struct CFeetData
{
    int m_fFlags;

    Vector m_angEyeAngles;

    float m_flDuckAmount;
    float m_flLowerBodyYawTarget;
    float m_flFeetCycle;
    float m_flFeetYawRate;
};

struct CMatrixes
{
    matrix3x4_t* m_pMatrixRight;
    matrix3x4_t* m_pMatrixMiddle;
    matrix3x4_t* m_pMatrixLeft;
};

C++:
void AnimationFix::Instance(ClientFrameStage_t stage)
{
    if (!Globals::LocalPlayer || !g_pEngine->IsInGame())
        return;

    static bool  wasDormant[65];

    for (int i = 1; i < g_pEngine->GetMaxClients(); ++i)
    {
        C_BaseEntity* pPlayerEntity = g_pEntityList->GetClientEntity(i);

        if (!pPlayerEntity || !pPlayerEntity->IsAlive())
        {
            ResetRecords();
            continue;
        }

        if (pPlayerEntity->IsDormant())
        {
            ResetRecords();
            wasDormant[i] = true;
            continue;
        }

        if (pPlayerEntity == Globals::LocalPlayer)
        {
            ResetRecords();
            continue;
        }

        if (stage == FRAME_RENDER_START)
        {
            HandleHits(pPlayerEntity);

            UpdateRecords(pPlayerEntity, true);
            UpdateAbsYaw(pPlayerEntity);

            Update(pPlayerEntity);

            UpdateResolverLayer(pPlayerEntity, 0, m_pAnimationData.m_flMiddleAngle, m_pMatrixes.m_pMatrixMiddle);
            UpdateResolverLayer(pPlayerEntity, 1, m_pAnimationData.m_flRightAngle, m_pMatrixes.m_pMatrixRight);
            UpdateResolverLayer(pPlayerEntity, 2, m_pAnimationData.m_flLeftAngle, m_pMatrixes.m_pMatrixLeft);

            UpdateRecords(pPlayerEntity, false);
            UpdateAbsYaw(pPlayerEntity);
        }
       
        if (stage == FRAME_NET_UPDATE_POSTDATAUPDATE_START) {
            if (Globals::MissedShots[pPlayerEntity->EntIndex()] > 1) {
                Bruteforce(pPlayerEntity);
                Resolver(pPlayerEntity, 0, m_pData.m_pfGuessedAngle);
            }
            else {
                ResolveViaLayers(pPlayerEntity);
                Update(pPlayerEntity);
                Resolver(pPlayerEntity, m_pData.m_iSide);
            }
        }

        wasDormant[i] = false;
    }
}

void AnimationFix::Update(C_BaseEntity* pEnt)
{
    float m_flSimulationTime = pEnt->GetSimulationTime();

    float m_flRealtime = g_pGlobalVars->realtime;
    float m_flCurtime = g_pGlobalVars->curtime;
    float m_flFrametime = g_pGlobalVars->frametime;
    float m_flAbsFrametime = g_pGlobalVars->absoluteframetime;
    float m_flInterpolation = g_pGlobalVars->interpolationAmount;
    float m_nFrames = g_pGlobalVars->framecount;
    float m_nTicks = g_pGlobalVars->tickcount;

    int m_iNextSimulationTick = m_flSimulationTime / g_pGlobalVars->intervalPerTick + 1;

    g_pGlobalVars->realtime = m_flSimulationTime;
    g_pGlobalVars->curtime = m_flSimulationTime;
    g_pGlobalVars->frametime = g_pGlobalVars->intervalPerTick;
    g_pGlobalVars->absoluteframetime = g_pGlobalVars->intervalPerTick;
    g_pGlobalVars->framecount = m_iNextSimulationTick;
    g_pGlobalVars->tickcount = m_iNextSimulationTick;
    g_pGlobalVars->interpolationAmount = 0.f;

    if (pEnt->AnimState()->m_iLastClientSideAnimationUpdateFramecount >= m_iNextSimulationTick)
        pEnt->AnimState()->m_iLastClientSideAnimationUpdateFramecount = m_iNextSimulationTick - 1;

    pEnt->ClientAnimations(true);
    pEnt->UpdateClientAnimation();

    g_pGlobalVars->realtime = m_flRealtime;
    g_pGlobalVars->curtime = m_flCurtime;
    g_pGlobalVars->frametime = m_flFrametime;
    g_pGlobalVars->absoluteframetime = m_flAbsFrametime;
    g_pGlobalVars->interpolationAmount = m_flInterpolation;
    g_pGlobalVars->framecount = m_nFrames;
    g_pGlobalVars->tickcount = m_nTicks;
}

void AnimationFix::UpdateLocal()
{
    m_pLocalData.m_aFakeAnimationState = nullptr;

    m_pLocalData.m_bUpdateFakeAnimation = true;
    m_pLocalData.m_bInitFakeAnimation = true;

    m_pLocalData.m_flSpawnTime = 0.f;

    if (!g_pEngine->IsConnected() || !Globals::LocalPlayer || !Globals::LocalPlayer->IsAlive())
    {
        m_pLocalData.m_bUpdateFakeAnimation = true;
        m_pLocalData.m_bInitFakeAnimation = true;
        m_pLocalData.m_flSpawnTime = 0.f;
        m_pLocalData.m_aFakeAnimationState = nullptr;
        return;
    }

    if (m_pLocalData.m_flSpawnTime != Globals::LocalPlayer->m_flSpawnTime() || m_pLocalData.m_bUpdateFakeAnimation)
    {
        m_pLocalData.m_flSpawnTime = Globals::LocalPlayer->m_flSpawnTime();
        m_pLocalData.m_bInitFakeAnimation = false;
        m_pLocalData.m_bUpdateFakeAnimation = false;
    }

    if (!m_pLocalData.m_bInitFakeAnimation)
    {
        m_pLocalData.m_aFakeAnimationState = static_cast<C_AnimState*>(g_pMemAlloc->Alloc(sizeof(C_AnimState)));

        if (m_pLocalData.m_aFakeAnimationState != nullptr)
            CreateAnimationState(m_pLocalData.m_aFakeAnimationState, Globals::LocalPlayer);

        m_pLocalData.m_bInitFakeAnimation = true;
    }

    if (m_pLocalData.m_bSendPacket)
    {
        std::memcpy(m_pLocalData.m_aServerLayers, Globals::LocalPlayer->AnimOverlays(), sizeof(AnimationLayer) * Globals::LocalPlayer->GetNumAnimOverlays());

        m_pLocalData.m_BackupAbsAngles = Globals::LocalPlayer->GetAbsAngles();
        m_pLocalData.m_flBackupPoseParameter = Globals::LocalPlayer->m_flPoseParameter();

        UpdateAnimationState(m_pLocalData.m_aFakeAnimationState, m_pLocalData.m_angViewAngles);

        Globals::LocalPlayer->InvalidateBoneCache();
        Globals::LocalPlayer->SetAbsAngles(Vector(0.f, m_pLocalData.m_aFakeAnimationState->m_flGoalFeetYaw, 0.f));

        std::memcpy(Globals::LocalPlayer->AnimOverlays(), m_pLocalData.m_aServerLayers, sizeof(AnimationLayer) * Globals::LocalPlayer->GetNumAnimOverlays());

        m_pLocalData.m_bMatrix = Globals::LocalPlayer->SetupBones(m_pLocalData.m_pFakeMatrix, 128, 0x7FF00, g_pGlobalVars->curtime);
        const Vector m_RenderOrigin = Globals::LocalPlayer->GetRenderOrigin();

        if (m_pLocalData.m_bMatrix)
        {
            for (auto& i : m_pLocalData.m_pFakeMatrix)
            {
                i[0][3] -= m_RenderOrigin.x;
                i[1][3] -= m_RenderOrigin.y;
                i[2][3] -= m_RenderOrigin.z;
            }
        }

        std::memcpy(Globals::LocalPlayer->AnimOverlays(), m_pLocalData.m_aServerLayers, sizeof(AnimationLayer) * Globals::LocalPlayer->GetNumAnimOverlays());
        std::memcpy(Globals::LocalPlayer->m_flPoseParameter(), m_pLocalData.m_flBackupPoseParameter, sizeof(float) * 24);

        Globals::LocalPlayer->SetAbsAngles(Vector(0.f, m_pLocalData.m_BackupAbsAngles.y, 0.f));
    }
}

void AnimationFix::ResetRecords()
{
    m_pAnimationData.m_flLeftAngle = 0.f;
    m_pAnimationData.m_flRightAngle = 0.f;
    m_pAnimationData.m_flMiddleAngle = 0.f;

    m_pLastData.m_bLeftDormancy = false;
    m_pLastData.m_aAnimationState = nullptr;
    m_pLastData.m_flFeetDelta = 0.f;
    m_pLastData.m_flDuckAmount = 0.f;
    m_pLastData.m_pfGuessedAngle = 0.f;
    m_pLastData.m_angEyeAngles = Vector(0.f, 0.f, 0.f);
    m_pLastData.m_bInAir = false;
    m_pLastData.m_nSpeed = 0.f;
    m_pLastData.m_nChoked = 0;

    m_pData.m_bLeftDormancy = false;
    m_pData.m_aAnimationState = nullptr;
    m_pData.m_flFeetDelta = 0.f;
    m_pData.m_flDuckAmount = 0.f;
    m_pData.m_pfGuessedAngle = 0.f;
    m_pData.m_angEyeAngles = Vector(0.f, 0.f, 0.f);
    m_pData.m_bInAir = false;
    m_pData.m_nSpeed = 0.f;
    m_pData.m_nChoked = 0;

    m_bRecordsUpdated = false;
}

void AnimationFix::UpdateRecords(C_BaseEntity* pEnt, bool m_bPrevious)
{
    if (!c_config::get().aimbot_resolver)
        return;

    m_pAnimationData.m_flLeftAngle = g_Math.AngleNormalize(pEnt->GetEyeAngles().y + 60.f);
    m_pAnimationData.m_flRightAngle = g_Math.AngleNormalize(pEnt->GetEyeAngles().y - 60.f);
    m_pAnimationData.m_flMiddleAngle = g_Math.AngleNormalize(pEnt->GetEyeAngles().y);

    if (!m_bPrevious)
    {
        m_pData.m_bLeftDormancy = g_Math.AngleNormalize(pEnt->GetEyeAngles().y) > 0.f ? true : false;
        m_pData.m_aAnimationState = pEnt->AnimState();
        m_pData.m_flFeetDelta = g_Math.AngleDifference(pEnt->GetEyeAngles().y, pEnt->AnimState()->m_flGoalFeetYaw);
        m_pData.m_flDuckAmount = pEnt->AnimState()->m_fDuckAmount;
        m_pData.m_angEyeAngles = pEnt->GetEyeAngles();
        m_pData.m_bInAir = ((pEnt->GetFlags() != FL_ONGROUND) || !(pEnt->GetFlags() & FL_ONGROUND));
        m_pData.m_nSpeed = pEnt->GetVelocity().Length2D();
        m_pData.m_nChoked = TIME_TO_TICKS(pEnt->GetSimulationTime() - pEnt->GetOldSimulationTime());
        std::memcpy(m_pData.m_aServerLayers, pEnt->AnimOverlays(), sizeof(AnimationLayer) * pEnt->GetNumAnimOverlays());
    }
    else
    {
        m_pLastData.m_bLeftDormancy = g_Math.AngleNormalize(pEnt->GetEyeAngles().y) > 0.f ? true : false;
        m_pLastData.m_aAnimationState = pEnt->AnimState();
        m_pLastData.m_flFeetDelta = g_Math.AngleDifference(pEnt->GetEyeAngles().y, pEnt->AnimState()->m_flGoalFeetYaw);
        m_pLastData.m_flDuckAmount = pEnt->AnimState()->m_fDuckAmount;
        m_pLastData.m_angEyeAngles = pEnt->GetEyeAngles();
        m_pLastData.m_bInAir = ((pEnt->GetFlags() != FL_ONGROUND) || !(pEnt->GetFlags() & FL_ONGROUND));
        m_pLastData.m_nSpeed = pEnt->GetVelocity().Length2D();
        m_pLastData.m_nChoked = TIME_TO_TICKS(pEnt->GetSimulationTime() - pEnt->GetOldSimulationTime());
        std::memcpy(m_pLastData.m_aServerLayers, pEnt->AnimOverlays(), sizeof(AnimationLayer) * pEnt->GetNumAnimOverlays());
    }

    m_bRecordsUpdated = true;
}

void AnimationFix::UpdateResolverLayer(C_BaseEntity* pEnt, int m_iLayerSide, float m_flAngle, matrix3x4_t* m_pMatrix)
{
    if (!c_config::get().aimbot_resolver)
        return;

    pEnt->AnimState()->m_flGoalFeetYaw = g_Math.AngleNormalize(m_flAngle);
    pEnt->UpdateClientAnimation();
    pEnt->SetupBones(m_pMatrix, 128, 0x0007FF00, g_pGlobalVars->curtime);
    std::memcpy(m_pData.m_aResolverLayers[m_iLayerSide], pEnt->AnimOverlays(), sizeof(AnimationLayer) * pEnt->GetNumAnimOverlays());

    m_bLayersUpdated = true;
}

void AnimationFix::UpdateAbsYaw(C_BaseEntity* pEnt)
{
    if (!c_config::get().aimbot_resolver)
        return;

    if (!m_pData.m_bInAir)
    {
        if (m_pData.m_nSpeed > 45.f)
        {
            if (m_pData.m_flFeetDelta > 0.f && m_pData.m_bLeftDormancy)
                m_pData.m_flLeftAbsYaw = pEnt->AnimState()->m_flGoalFeetYaw + 30.f;
            else
                m_pData.m_flRightAbsYaw = pEnt->AnimState()->m_flGoalFeetYaw - 30.f;
        }
        else if (m_pData.m_nSpeed <= 45.f && m_pData.m_nSpeed > 8.f)
        {
            if (m_pData.m_flFeetDelta > 0.f && m_pData.m_bLeftDormancy)
                m_pData.m_flLeftAbsYaw = pEnt->AnimState()->m_flGoalFeetYaw + 60.f;
            else
                m_pData.m_flRightAbsYaw = pEnt->AnimState()->m_flGoalFeetYaw - 60.f;
        }
        else if (m_pData.m_nSpeed <= 8.f)
        {
            if (m_pData.m_flFeetDelta > 0.f && m_pData.m_bLeftDormancy)
                m_pData.m_flLeftAbsYaw = pEnt->AnimState()->m_flGoalFeetYaw + 60.f;
            else
                m_pData.m_flRightAbsYaw = pEnt->AnimState()->m_flGoalFeetYaw - 60.f;
        }
    }
    else if (m_pData.m_bInAir)
    {
        if (m_pData.m_nSpeed > 45.f)
        {
            if (m_pData.m_flFeetDelta > 0.f || m_pData.m_bLeftDormancy)
                m_pData.m_flLeftAbsYaw = pEnt->AnimState()->m_flGoalFeetYaw + 15.f;
            else
                m_pData.m_flRightAbsYaw = pEnt->AnimState()->m_flGoalFeetYaw - 15.f;
        }
    }

    m_bAbsYawUpdated = true;
}

void AnimationFix::SaveFeetAnimations(C_BaseEntity* pEnt)
{
    m_FeetData.m_fFlags = pEnt->GetFlags();
    m_FeetData.m_angEyeAngles = pEnt->GetEyeAngles();
    m_FeetData.m_flDuckAmount = pEnt->AnimState()->m_fDuckAmount;
    m_FeetData.m_flLowerBodyYawTarget = pEnt->GetLowerBodyYaw();
    m_FeetData.m_flFeetCycle = pEnt->AnimState()->m_flFeetCycle;
    m_FeetData.m_flFeetYawRate = pEnt->AnimState()->m_flFeetYawRate;
}

void AnimationFix::RestoreFeetAnimations(C_BaseEntity* pEnt)
{
    pEnt->SetFlags(m_FeetData.m_fFlags);
    pEnt->SetEyeAngles(m_FeetData.m_angEyeAngles);
    pEnt->AnimState()->m_fDuckAmount = m_FeetData.m_flDuckAmount;
    pEnt->SetLowerBodyYaw(m_FeetData.m_flLowerBodyYawTarget);
    pEnt->AnimState()->m_flFeetCycle = m_FeetData.m_flFeetCycle;
    pEnt->AnimState()->m_flFeetYawRate = m_FeetData.m_flFeetYawRate;
}

void AnimationFix::ResolveViaLayers(C_BaseEntity* pEnt)
{
    if (!c_config::get().aimbot_resolver)
        return;

    if (!m_pData.m_bInAir)
    {
        if (m_pData.m_nSpeed <= 0.1)
        {
            if (m_pData.m_aServerLayers[3].m_flWeight == 0.f && m_pData.m_aServerLayers[3].m_flCycle == 0.f && m_pData.m_aServerLayers[6].m_flWeight == 0.f)
            {
                m_pData.m_iSide = 2 * (m_pData.m_flFeetDelta <= 0.0) - 1;
            }
        }
        else if (!(m_pData.m_aServerLayers[12].m_flWeight * 1000.f))
        {
            if (int(m_pData.m_aServerLayers[6].m_flWeight * 1000.f) == int(m_pLastData.m_aServerLayers[6].m_flWeight * 1000.f))
            {
                float DeltaFirst = abs(m_pData.m_aServerLayers[6].m_flPlaybackRate - m_pData.m_aResolverLayers[0][6].m_flPlaybackRate);
                float DeltaSecond = abs(m_pData.m_aServerLayers[6].m_flPlaybackRate - m_pData.m_aResolverLayers[1][6].m_flPlaybackRate);
                float DeltaThird = abs(m_pData.m_aServerLayers[6].m_flPlaybackRate - m_pData.m_aResolverLayers[2][6].m_flPlaybackRate);

                if (DeltaFirst < DeltaSecond || DeltaThird <= DeltaSecond || (DeltaSecond * 1000.0))
                {
                    if (DeltaFirst >= DeltaThird && DeltaSecond > DeltaThird && !(DeltaThird * 1000.0))
                    {
                        m_pData.m_iSide = 1;
                    }
                }
                else
                {
                    m_pData.m_iSide = -1;
                }
            }
        }
    }
}

void AnimationFix::Resolver(C_BaseEntity* pEnt, int m_iSide, float m_pfGuessedAngle)
{
    if (!c_config::get().aimbot_resolver || pEnt->GetTeam() == Globals::LocalPlayer->GetTeam() || pEnt == Globals::LocalPlayer || pEnt->IsDormant())
        return;

    SaveFeetAnimations(pEnt);

    pEnt->SetAbsOrigin(pEnt->GetVecOrigin());

    if (m_pLastData.m_bLeftDormancy)
    {
        std::memcpy(pEnt->AnimOverlays(), m_pData.m_aServerLayers, sizeof(AnimationLayer) * pEnt->GetNumAnimOverlays());
    }
    else
    {
        std::memcpy(pEnt->AnimOverlays(), m_pLastData.m_aServerLayers, sizeof(AnimationLayer) * pEnt->GetNumAnimOverlays());
    }

    float m_flBruteAngle = m_pData.m_angEyeAngles.y;

    if (m_pData.m_nChoked == 1)
    {
        if (m_iSide)
        {
            if (m_iSide > 0)
            {
                if (m_pLastData.m_bLeftDormancy)
                    m_flBruteAngle -= 60.f;
                else
                    m_flBruteAngle = m_pAnimationData.m_flLeftAngle;
            }
            else if (m_iSide < 0)
            {
                if (m_pLastData.m_bLeftDormancy)
                    m_flBruteAngle += 60.f;
                else
                    m_flBruteAngle = m_pAnimationData.m_flRightAngle;
            }
        }
        else if (m_pfGuessedAngle)
            m_flBruteAngle = m_pfGuessedAngle;
    }
    else if (m_pData.m_nChoked)
    {
        m_flBruteAngle += 60 * ((m_iSide <= 0) ? -1 : 1);
    }

    pEnt->AnimState()->m_flGoalFeetYaw = g_Math.AngleNormalize(m_flBruteAngle);

    Update(pEnt);

    RestoreFeetAnimations(pEnt);
}

void AnimationFix::AntiFreestand()
{
    if (!c_config::get().aimbot_resolver)
        return;

    if (!Globals::LocalPlayer->IsAlive())
        return;

    if (!Globals::LocalPlayer->GetActiveWeapon() || Globals::LocalPlayer->IsKnifeorNade())
        return;


    for (int i = 1; i < g_pEngine->GetMaxClients(); ++i)
    {
        C_BaseEntity* pPlayerEntity = g_pEntityList->GetClientEntity(i);

        if (!pPlayerEntity
            || !pPlayerEntity->IsAlive()
            || pPlayerEntity->IsDormant()
            || pPlayerEntity == Globals::LocalPlayer
            || pPlayerEntity->GetTeam() == Globals::LocalPlayer->GetTeam())
        {
            UseFreestandAngle[i] = false;
            continue;
        }

        if (abs(pPlayerEntity->GetVelocity().Length2D()) > 29.f)
            UseFreestandAngle[pPlayerEntity->EntIndex()] = false;

        if (abs(pPlayerEntity->GetVelocity().Length2D()) <= 29.f && !UseFreestandAngle[pPlayerEntity->EntIndex()])
        {
            bool Autowalled = false, HitSide1 = false, HitSide2 = false;

            float angToLocal = g_Math.CalcAngle(Globals::LocalPlayer->GetOrigin(), pPlayerEntity->GetOrigin()).y;
            Vector ViewPoint = Globals::LocalPlayer->GetOrigin() + Vector(0, 0, 90);

            Vector2D Side1 = { (45 * sin(g_Math.GRD_TO_BOG(angToLocal))),(45 * cos(g_Math.GRD_TO_BOG(angToLocal))) };
            Vector2D Side2 = { (45 * sin(g_Math.GRD_TO_BOG(angToLocal + 180))) ,(45 * cos(g_Math.GRD_TO_BOG(angToLocal + 180))) };

            Vector2D Side3 = { (50 * sin(g_Math.GRD_TO_BOG(angToLocal))),(50 * cos(g_Math.GRD_TO_BOG(angToLocal))) };
            Vector2D Side4 = { (50 * sin(g_Math.GRD_TO_BOG(angToLocal + 180))) ,(50 * cos(g_Math.GRD_TO_BOG(angToLocal + 180))) };

            Vector Origin = pPlayerEntity->GetOrigin();

            Vector2D OriginLeftRight[] = { Vector2D(Side1.x, Side1.y), Vector2D(Side2.x, Side2.y) };

            Vector2D OriginLeftRightLocal[] = { Vector2D(Side3.x, Side3.y), Vector2D(Side4.x, Side4.y) };

            for (int side = 0; side < 2; side++)
            {
                Vector OriginAutowall = { Origin.x + OriginLeftRight[side].x,  Origin.y - OriginLeftRight[side].y , Origin.z + 90 };
                Vector OriginAutowall2 = { ViewPoint.x + OriginLeftRightLocal[side].x,  ViewPoint.y - OriginLeftRightLocal[side].y , ViewPoint.z };

                if (g_Autowall.CanHitFloatingPoint(OriginAutowall, ViewPoint))
                {
                    if (side == 0)
                    {
                        HitSide1 = true;
                        FreestandAngle[pPlayerEntity->EntIndex()] = 90;
                    }
                    else if (side == 1)
                    {
                        HitSide2 = true;
                        FreestandAngle[pPlayerEntity->EntIndex()] = -90;
                    }

                    Autowalled = true;
                }
                else
                {
                    for (int side222 = 0; side222 < 2; side222++)
                    {
                        Vector OriginAutowall222 = { Origin.x + OriginLeftRight[side222].x,  Origin.y - OriginLeftRight[side222].y , Origin.z + 90 };

                        if (g_Autowall.CanHitFloatingPoint(OriginAutowall222, OriginAutowall2))
                        {
                            if (side222 == 0)
                            {
                                HitSide1 = true;
                                FreestandAngle[pPlayerEntity->EntIndex()] = 90;
                            }
                            else if (side222 == 1)
                            {
                                HitSide2 = true;
                                FreestandAngle[pPlayerEntity->EntIndex()] = -90;
                            }

                            Autowalled = true;
                        }
                    }
                }
            }

            if (Autowalled)
            {
                if (HitSide1 && HitSide2)
                    UseFreestandAngle[pPlayerEntity->EntIndex()] = false;
                else
                    UseFreestandAngle[pPlayerEntity->EntIndex()] = true;
            }
        }
    }
}

void AnimationFix::Bruteforce(C_BaseEntity* pEnt)
{
    switch (Globals::MissedShots[pEnt->EntIndex()] % 6)
    {
    case 0:
        m_pData.m_pfGuessedAngle = m_pData.m_flLeftAbsYaw;
        break;
    case 1:
        m_pData.m_pfGuessedAngle = m_pData.m_flRightAbsYaw;
        break;
    case 2:
        m_pData.m_pfGuessedAngle = m_pData.m_flLeftAbsYaw;
        break;
    case 3:
        m_pData.m_pfGuessedAngle = m_pData.m_flRightAbsYaw;
        break;
    case 4:
        m_pData.m_pfGuessedAngle = m_pData.m_flLeftAbsYaw;
        break;
    case 5:
        m_pData.m_pfGuessedAngle = m_pData.m_flRightAbsYaw;
        break;
    case 6:
        m_pData.m_pfGuessedAngle = m_pData.m_flLeftAbsYaw;
        break;
    }
}

void AnimationFix::HandleHits(C_BaseEntity* pEnt)
{
    auto NetChannel = g_pEngine->GetNetChannelInfo();

    if (!NetChannel)
        return;

    static float predTime[65];
    static bool init[65];

    if (Globals::Shot[pEnt->EntIndex()])
    {
        if (init[pEnt->EntIndex()])
        {
            g_AnimationFix.pitchHit[pEnt->EntIndex()] = pEnt->GetEyeAngles().x;
            predTime[pEnt->EntIndex()] = g_pGlobalVars->curtime + NetChannel->GetAvgLatency(FLOW_INCOMING) + NetChannel->GetAvgLatency(FLOW_OUTGOING) + TICKS_TO_TIME(1) + TICKS_TO_TIME(g_pEngine->GetNetChannel()->m_nChokedPackets);
            init[pEnt->EntIndex()] = false;
        }

        if (g_pGlobalVars->curtime > predTime[pEnt->EntIndex()] && !Globals::Hit[pEnt->EntIndex()])
        {
            Globals::MissedShots[pEnt->EntIndex()] += 1;
            Globals::Shot[pEnt->EntIndex()] = false;
        }
        else if (g_pGlobalVars->curtime <= predTime[pEnt->EntIndex()] && Globals::Hit[pEnt->EntIndex()])
            Globals::Shot[pEnt->EntIndex()] = false;

    }
    else
        init[pEnt->EntIndex()] = true;

    Globals::Hit[pEnt->EntIndex()] = false;
}
 
Последнее редактирование:
Участник
Статус
Оффлайн
Регистрация
26 Апр 2018
Сообщения
851
Реакции[?]
181
Поинты[?]
0
я вобще не понимаю нахрана это говно ты сюда закинул, фристент резольвер от (хуо гемини и ему падобных) матрикс резольвер без апореч ничтожен так моделька при спине может крутится по оси 360, куча разного не додела бл. за..... вы все говно постить сво... бомбит и еще на 23 февраля. AkatsukiSun ты зачем лайкнул ему это в миллион раз выкладывали и то было лучше.
 
get good get legendware
Участник
Статус
Оффлайн
Регистрация
22 Сен 2020
Сообщения
437
Реакции[?]
201
Поинты[?]
48K
C++:
pEnt->AnimState()->m_flGoalFeetYaw = g_Math.AngleNormalize(m_flBruteAngle);
lol……….
please tell me you didn’t pay for that shit
 
Участник
Статус
Оффлайн
Регистрация
26 Апр 2018
Сообщения
851
Реакции[?]
181
Поинты[?]
0
C++:
pEnt->AnimState()->m_flGoalFeetYaw = g_Math.AngleNormalize(m_flBruteAngle);
lol……….
please tell me you didn’t pay for that shit
так он и не платил это говно с 2018 года на юг лежит там еще дофига на 5 тысяч строк, все что можно было тогда собрать туда запихали он тупа выбрал куски кода оттуда и залил сюда.
 
get good get legendware
Участник
Статус
Оффлайн
Регистрация
22 Сен 2020
Сообщения
437
Реакции[?]
201
Поинты[?]
48K
так он и не платил это говно с 2018 года на юг лежит там еще дофига на 5 тысяч строк, все что можно было тогда собрать туда запихали он тупа выбрал куски кода оттуда и залил сюда.
sad
 
Эксперт
Статус
Оффлайн
Регистрация
30 Дек 2019
Сообщения
1,967
Реакции[?]
958
Поинты[?]
19K
1645639326023.png
Animation fix and resolver.
C++:
struct CLocalData
{
    bool m_bSendPacket;
    bool m_bMatrix;
    bool m_bUpdateFakeAnimation;
    bool m_bInitFakeAnimation;

    float m_flSpawnTime;
    float* m_flBackupPoseParameter;

    Vector m_angViewAngles;
    Vector m_BackupAbsAngles;

    matrix3x4_t m_pFakeMatrix[128];

    C_AnimState* m_aFakeAnimationState;
    AnimationLayer m_aServerLayers[13];
};

struct CResolverData
{
    float m_flRightAbsYaw;
    float m_flLeftAbsYaw;
    float m_flFeetDelta;
    float m_flDuckAmount;
    float m_nSpeed;
    float m_pfGuessedAngle;

    int m_nChoked;
    int m_iSide;

    AnimationLayer m_aServerLayers[13];
    AnimationLayer m_aResolverLayers[3][13];

    C_AnimState* m_aAnimationState;

    Vector m_angEyeAngles;

    bool m_bLeftDormancy;
    bool m_bInAir;
};

struct CAnimationData
{
    float m_flRightAngle;
    float m_flMiddleAngle;
    float m_flLeftAngle;
};

struct CFeetData
{
    int m_fFlags;

    Vector m_angEyeAngles;

    float m_flDuckAmount;
    float m_flLowerBodyYawTarget;
    float m_flFeetCycle;
    float m_flFeetYawRate;
};

struct CMatrixes
{
    matrix3x4_t* m_pMatrixRight;
    matrix3x4_t* m_pMatrixMiddle;
    matrix3x4_t* m_pMatrixLeft;
};

C++:
void AnimationFix::Instance(ClientFrameStage_t stage)
{
    if (!Globals::LocalPlayer || !g_pEngine->IsInGame())
        return;

    static bool  wasDormant[65];

    for (int i = 1; i < g_pEngine->GetMaxClients(); ++i)
    {
        C_BaseEntity* pPlayerEntity = g_pEntityList->GetClientEntity(i);

        if (!pPlayerEntity || !pPlayerEntity->IsAlive())
        {
            ResetRecords();
            continue;
        }

        if (pPlayerEntity->IsDormant())
        {
            ResetRecords();
            wasDormant[i] = true;
            continue;
        }

        if (pPlayerEntity == Globals::LocalPlayer)
        {
            ResetRecords();
            continue;
        }

        if (stage == FRAME_RENDER_START)
        {
            HandleHits(pPlayerEntity);

            UpdateRecords(pPlayerEntity, true);
            UpdateAbsYaw(pPlayerEntity);

            Update(pPlayerEntity);

            UpdateResolverLayer(pPlayerEntity, 0, m_pAnimationData.m_flMiddleAngle, m_pMatrixes.m_pMatrixMiddle);
            UpdateResolverLayer(pPlayerEntity, 1, m_pAnimationData.m_flRightAngle, m_pMatrixes.m_pMatrixRight);
            UpdateResolverLayer(pPlayerEntity, 2, m_pAnimationData.m_flLeftAngle, m_pMatrixes.m_pMatrixLeft);

            UpdateRecords(pPlayerEntity, false);
            UpdateAbsYaw(pPlayerEntity);
        }
      
        if (stage == FRAME_NET_UPDATE_POSTDATAUPDATE_START) {
            if (Globals::MissedShots[pPlayerEntity->EntIndex()] > 1) {
                Bruteforce(pPlayerEntity);
                Resolver(pPlayerEntity, 0, m_pData.m_pfGuessedAngle);
            }
            else {
                ResolveViaLayers(pPlayerEntity);
                Update(pPlayerEntity);
                Resolver(pPlayerEntity, m_pData.m_iSide);
            }
        }

        wasDormant[i] = false;
    }
}

void AnimationFix::Update(C_BaseEntity* pEnt)
{
    float m_flSimulationTime = pEnt->GetSimulationTime();

    float m_flRealtime = g_pGlobalVars->realtime;
    float m_flCurtime = g_pGlobalVars->curtime;
    float m_flFrametime = g_pGlobalVars->frametime;
    float m_flAbsFrametime = g_pGlobalVars->absoluteframetime;
    float m_flInterpolation = g_pGlobalVars->interpolationAmount;
    float m_nFrames = g_pGlobalVars->framecount;
    float m_nTicks = g_pGlobalVars->tickcount;

    int m_iNextSimulationTick = m_flSimulationTime / g_pGlobalVars->intervalPerTick + 1;

    g_pGlobalVars->realtime = m_flSimulationTime;
    g_pGlobalVars->curtime = m_flSimulationTime;
    g_pGlobalVars->frametime = g_pGlobalVars->intervalPerTick;
    g_pGlobalVars->absoluteframetime = g_pGlobalVars->intervalPerTick;
    g_pGlobalVars->framecount = m_iNextSimulationTick;
    g_pGlobalVars->tickcount = m_iNextSimulationTick;
    g_pGlobalVars->interpolationAmount = 0.f;

    if (pEnt->AnimState()->m_iLastClientSideAnimationUpdateFramecount >= m_iNextSimulationTick)
        pEnt->AnimState()->m_iLastClientSideAnimationUpdateFramecount = m_iNextSimulationTick - 1;

    pEnt->ClientAnimations(true);
    pEnt->UpdateClientAnimation();

    g_pGlobalVars->realtime = m_flRealtime;
    g_pGlobalVars->curtime = m_flCurtime;
    g_pGlobalVars->frametime = m_flFrametime;
    g_pGlobalVars->absoluteframetime = m_flAbsFrametime;
    g_pGlobalVars->interpolationAmount = m_flInterpolation;
    g_pGlobalVars->framecount = m_nFrames;
    g_pGlobalVars->tickcount = m_nTicks;
}

void AnimationFix::UpdateLocal()
{
    m_pLocalData.m_aFakeAnimationState = nullptr;

    m_pLocalData.m_bUpdateFakeAnimation = true;
    m_pLocalData.m_bInitFakeAnimation = true;

    m_pLocalData.m_flSpawnTime = 0.f;

    if (!g_pEngine->IsConnected() || !Globals::LocalPlayer || !Globals::LocalPlayer->IsAlive())
    {
        m_pLocalData.m_bUpdateFakeAnimation = true;
        m_pLocalData.m_bInitFakeAnimation = true;
        m_pLocalData.m_flSpawnTime = 0.f;
        m_pLocalData.m_aFakeAnimationState = nullptr;
        return;
    }

    if (m_pLocalData.m_flSpawnTime != Globals::LocalPlayer->m_flSpawnTime() || m_pLocalData.m_bUpdateFakeAnimation)
    {
        m_pLocalData.m_flSpawnTime = Globals::LocalPlayer->m_flSpawnTime();
        m_pLocalData.m_bInitFakeAnimation = false;
        m_pLocalData.m_bUpdateFakeAnimation = false;
    }

    if (!m_pLocalData.m_bInitFakeAnimation)
    {
        m_pLocalData.m_aFakeAnimationState = static_cast<C_AnimState*>(g_pMemAlloc->Alloc(sizeof(C_AnimState)));

        if (m_pLocalData.m_aFakeAnimationState != nullptr)
            CreateAnimationState(m_pLocalData.m_aFakeAnimationState, Globals::LocalPlayer);

        m_pLocalData.m_bInitFakeAnimation = true;
    }

    if (m_pLocalData.m_bSendPacket)
    {
        std::memcpy(m_pLocalData.m_aServerLayers, Globals::LocalPlayer->AnimOverlays(), sizeof(AnimationLayer) * Globals::LocalPlayer->GetNumAnimOverlays());

        m_pLocalData.m_BackupAbsAngles = Globals::LocalPlayer->GetAbsAngles();
        m_pLocalData.m_flBackupPoseParameter = Globals::LocalPlayer->m_flPoseParameter();

        UpdateAnimationState(m_pLocalData.m_aFakeAnimationState, m_pLocalData.m_angViewAngles);

        Globals::LocalPlayer->InvalidateBoneCache();
        Globals::LocalPlayer->SetAbsAngles(Vector(0.f, m_pLocalData.m_aFakeAnimationState->m_flGoalFeetYaw, 0.f));

        std::memcpy(Globals::LocalPlayer->AnimOverlays(), m_pLocalData.m_aServerLayers, sizeof(AnimationLayer) * Globals::LocalPlayer->GetNumAnimOverlays());

        m_pLocalData.m_bMatrix = Globals::LocalPlayer->SetupBones(m_pLocalData.m_pFakeMatrix, 128, 0x7FF00, g_pGlobalVars->curtime);
        const Vector m_RenderOrigin = Globals::LocalPlayer->GetRenderOrigin();

        if (m_pLocalData.m_bMatrix)
        {
            for (auto& i : m_pLocalData.m_pFakeMatrix)
            {
                i[0][3] -= m_RenderOrigin.x;
                i[1][3] -= m_RenderOrigin.y;
                i[2][3] -= m_RenderOrigin.z;
            }
        }

        std::memcpy(Globals::LocalPlayer->AnimOverlays(), m_pLocalData.m_aServerLayers, sizeof(AnimationLayer) * Globals::LocalPlayer->GetNumAnimOverlays());
        std::memcpy(Globals::LocalPlayer->m_flPoseParameter(), m_pLocalData.m_flBackupPoseParameter, sizeof(float) * 24);

        Globals::LocalPlayer->SetAbsAngles(Vector(0.f, m_pLocalData.m_BackupAbsAngles.y, 0.f));
    }
}

void AnimationFix::ResetRecords()
{
    m_pAnimationData.m_flLeftAngle = 0.f;
    m_pAnimationData.m_flRightAngle = 0.f;
    m_pAnimationData.m_flMiddleAngle = 0.f;

    m_pLastData.m_bLeftDormancy = false;
    m_pLastData.m_aAnimationState = nullptr;
    m_pLastData.m_flFeetDelta = 0.f;
    m_pLastData.m_flDuckAmount = 0.f;
    m_pLastData.m_pfGuessedAngle = 0.f;
    m_pLastData.m_angEyeAngles = Vector(0.f, 0.f, 0.f);
    m_pLastData.m_bInAir = false;
    m_pLastData.m_nSpeed = 0.f;
    m_pLastData.m_nChoked = 0;

    m_pData.m_bLeftDormancy = false;
    m_pData.m_aAnimationState = nullptr;
    m_pData.m_flFeetDelta = 0.f;
    m_pData.m_flDuckAmount = 0.f;
    m_pData.m_pfGuessedAngle = 0.f;
    m_pData.m_angEyeAngles = Vector(0.f, 0.f, 0.f);
    m_pData.m_bInAir = false;
    m_pData.m_nSpeed = 0.f;
    m_pData.m_nChoked = 0;

    m_bRecordsUpdated = false;
}

void AnimationFix::UpdateRecords(C_BaseEntity* pEnt, bool m_bPrevious)
{
    if (!c_config::get().aimbot_resolver)
        return;

    m_pAnimationData.m_flLeftAngle = g_Math.AngleNormalize(pEnt->GetEyeAngles().y + 60.f);
    m_pAnimationData.m_flRightAngle = g_Math.AngleNormalize(pEnt->GetEyeAngles().y - 60.f);
    m_pAnimationData.m_flMiddleAngle = g_Math.AngleNormalize(pEnt->GetEyeAngles().y);

    if (!m_bPrevious)
    {
        m_pData.m_bLeftDormancy = g_Math.AngleNormalize(pEnt->GetEyeAngles().y) > 0.f ? true : false;
        m_pData.m_aAnimationState = pEnt->AnimState();
        m_pData.m_flFeetDelta = g_Math.AngleDifference(pEnt->GetEyeAngles().y, pEnt->AnimState()->m_flGoalFeetYaw);
        m_pData.m_flDuckAmount = pEnt->AnimState()->m_fDuckAmount;
        m_pData.m_angEyeAngles = pEnt->GetEyeAngles();
        m_pData.m_bInAir = ((pEnt->GetFlags() != FL_ONGROUND) || !(pEnt->GetFlags() & FL_ONGROUND));
        m_pData.m_nSpeed = pEnt->GetVelocity().Length2D();
        m_pData.m_nChoked = TIME_TO_TICKS(pEnt->GetSimulationTime() - pEnt->GetOldSimulationTime());
        std::memcpy(m_pData.m_aServerLayers, pEnt->AnimOverlays(), sizeof(AnimationLayer) * pEnt->GetNumAnimOverlays());
    }
    else
    {
        m_pLastData.m_bLeftDormancy = g_Math.AngleNormalize(pEnt->GetEyeAngles().y) > 0.f ? true : false;
        m_pLastData.m_aAnimationState = pEnt->AnimState();
        m_pLastData.m_flFeetDelta = g_Math.AngleDifference(pEnt->GetEyeAngles().y, pEnt->AnimState()->m_flGoalFeetYaw);
        m_pLastData.m_flDuckAmount = pEnt->AnimState()->m_fDuckAmount;
        m_pLastData.m_angEyeAngles = pEnt->GetEyeAngles();
        m_pLastData.m_bInAir = ((pEnt->GetFlags() != FL_ONGROUND) || !(pEnt->GetFlags() & FL_ONGROUND));
        m_pLastData.m_nSpeed = pEnt->GetVelocity().Length2D();
        m_pLastData.m_nChoked = TIME_TO_TICKS(pEnt->GetSimulationTime() - pEnt->GetOldSimulationTime());
        std::memcpy(m_pLastData.m_aServerLayers, pEnt->AnimOverlays(), sizeof(AnimationLayer) * pEnt->GetNumAnimOverlays());
    }

    m_bRecordsUpdated = true;
}

void AnimationFix::UpdateResolverLayer(C_BaseEntity* pEnt, int m_iLayerSide, float m_flAngle, matrix3x4_t* m_pMatrix)
{
    if (!c_config::get().aimbot_resolver)
        return;

    pEnt->AnimState()->m_flGoalFeetYaw = g_Math.AngleNormalize(m_flAngle);
    pEnt->UpdateClientAnimation();
    pEnt->SetupBones(m_pMatrix, 128, 0x0007FF00, g_pGlobalVars->curtime);
    std::memcpy(m_pData.m_aResolverLayers[m_iLayerSide], pEnt->AnimOverlays(), sizeof(AnimationLayer) * pEnt->GetNumAnimOverlays());

    m_bLayersUpdated = true;
}

void AnimationFix::UpdateAbsYaw(C_BaseEntity* pEnt)
{
    if (!c_config::get().aimbot_resolver)
        return;

    if (!m_pData.m_bInAir)
    {
        if (m_pData.m_nSpeed > 45.f)
        {
            if (m_pData.m_flFeetDelta > 0.f && m_pData.m_bLeftDormancy)
                m_pData.m_flLeftAbsYaw = pEnt->AnimState()->m_flGoalFeetYaw + 30.f;
            else
                m_pData.m_flRightAbsYaw = pEnt->AnimState()->m_flGoalFeetYaw - 30.f;
        }
        else if (m_pData.m_nSpeed <= 45.f && m_pData.m_nSpeed > 8.f)
        {
            if (m_pData.m_flFeetDelta > 0.f && m_pData.m_bLeftDormancy)
                m_pData.m_flLeftAbsYaw = pEnt->AnimState()->m_flGoalFeetYaw + 60.f;
            else
                m_pData.m_flRightAbsYaw = pEnt->AnimState()->m_flGoalFeetYaw - 60.f;
        }
        else if (m_pData.m_nSpeed <= 8.f)
        {
            if (m_pData.m_flFeetDelta > 0.f && m_pData.m_bLeftDormancy)
                m_pData.m_flLeftAbsYaw = pEnt->AnimState()->m_flGoalFeetYaw + 60.f;
            else
                m_pData.m_flRightAbsYaw = pEnt->AnimState()->m_flGoalFeetYaw - 60.f;
        }
    }
    else if (m_pData.m_bInAir)
    {
        if (m_pData.m_nSpeed > 45.f)
        {
            if (m_pData.m_flFeetDelta > 0.f || m_pData.m_bLeftDormancy)
                m_pData.m_flLeftAbsYaw = pEnt->AnimState()->m_flGoalFeetYaw + 15.f;
            else
                m_pData.m_flRightAbsYaw = pEnt->AnimState()->m_flGoalFeetYaw - 15.f;
        }
    }

    m_bAbsYawUpdated = true;
}

void AnimationFix::SaveFeetAnimations(C_BaseEntity* pEnt)
{
    m_FeetData.m_fFlags = pEnt->GetFlags();
    m_FeetData.m_angEyeAngles = pEnt->GetEyeAngles();
    m_FeetData.m_flDuckAmount = pEnt->AnimState()->m_fDuckAmount;
    m_FeetData.m_flLowerBodyYawTarget = pEnt->GetLowerBodyYaw();
    m_FeetData.m_flFeetCycle = pEnt->AnimState()->m_flFeetCycle;
    m_FeetData.m_flFeetYawRate = pEnt->AnimState()->m_flFeetYawRate;
}

void AnimationFix::RestoreFeetAnimations(C_BaseEntity* pEnt)
{
    pEnt->SetFlags(m_FeetData.m_fFlags);
    pEnt->SetEyeAngles(m_FeetData.m_angEyeAngles);
    pEnt->AnimState()->m_fDuckAmount = m_FeetData.m_flDuckAmount;
    pEnt->SetLowerBodyYaw(m_FeetData.m_flLowerBodyYawTarget);
    pEnt->AnimState()->m_flFeetCycle = m_FeetData.m_flFeetCycle;
    pEnt->AnimState()->m_flFeetYawRate = m_FeetData.m_flFeetYawRate;
}

void AnimationFix::ResolveViaLayers(C_BaseEntity* pEnt)
{
    if (!c_config::get().aimbot_resolver)
        return;

    if (!m_pData.m_bInAir)
    {
        if (m_pData.m_nSpeed <= 0.1)
        {
            if (m_pData.m_aServerLayers[3].m_flWeight == 0.f && m_pData.m_aServerLayers[3].m_flCycle == 0.f && m_pData.m_aServerLayers[6].m_flWeight == 0.f)
            {
                m_pData.m_iSide = 2 * (m_pData.m_flFeetDelta <= 0.0) - 1;
            }
        }
        else if (!(m_pData.m_aServerLayers[12].m_flWeight * 1000.f))
        {
            if (int(m_pData.m_aServerLayers[6].m_flWeight * 1000.f) == int(m_pLastData.m_aServerLayers[6].m_flWeight * 1000.f))
            {
                float DeltaFirst = abs(m_pData.m_aServerLayers[6].m_flPlaybackRate - m_pData.m_aResolverLayers[0][6].m_flPlaybackRate);
                float DeltaSecond = abs(m_pData.m_aServerLayers[6].m_flPlaybackRate - m_pData.m_aResolverLayers[1][6].m_flPlaybackRate);
                float DeltaThird = abs(m_pData.m_aServerLayers[6].m_flPlaybackRate - m_pData.m_aResolverLayers[2][6].m_flPlaybackRate);

                if (DeltaFirst < DeltaSecond || DeltaThird <= DeltaSecond || (DeltaSecond * 1000.0))
                {
                    if (DeltaFirst >= DeltaThird && DeltaSecond > DeltaThird && !(DeltaThird * 1000.0))
                    {
                        m_pData.m_iSide = 1;
                    }
                }
                else
                {
                    m_pData.m_iSide = -1;
                }
            }
        }
    }
}

void AnimationFix::Resolver(C_BaseEntity* pEnt, int m_iSide, float m_pfGuessedAngle)
{
    if (!c_config::get().aimbot_resolver || pEnt->GetTeam() == Globals::LocalPlayer->GetTeam() || pEnt == Globals::LocalPlayer || pEnt->IsDormant())
        return;

    SaveFeetAnimations(pEnt);

    pEnt->SetAbsOrigin(pEnt->GetVecOrigin());

    if (m_pLastData.m_bLeftDormancy)
    {
        std::memcpy(pEnt->AnimOverlays(), m_pData.m_aServerLayers, sizeof(AnimationLayer) * pEnt->GetNumAnimOverlays());
    }
    else
    {
        std::memcpy(pEnt->AnimOverlays(), m_pLastData.m_aServerLayers, sizeof(AnimationLayer) * pEnt->GetNumAnimOverlays());
    }

    float m_flBruteAngle = m_pData.m_angEyeAngles.y;

    if (m_pData.m_nChoked == 1)
    {
        if (m_iSide)
        {
            if (m_iSide > 0)
            {
                if (m_pLastData.m_bLeftDormancy)
                    m_flBruteAngle -= 60.f;
                else
                    m_flBruteAngle = m_pAnimationData.m_flLeftAngle;
            }
            else if (m_iSide < 0)
            {
                if (m_pLastData.m_bLeftDormancy)
                    m_flBruteAngle += 60.f;
                else
                    m_flBruteAngle = m_pAnimationData.m_flRightAngle;
            }
        }
        else if (m_pfGuessedAngle)
            m_flBruteAngle = m_pfGuessedAngle;
    }
    else if (m_pData.m_nChoked)
    {
        m_flBruteAngle += 60 * ((m_iSide <= 0) ? -1 : 1);
    }

    pEnt->AnimState()->m_flGoalFeetYaw = g_Math.AngleNormalize(m_flBruteAngle);

    Update(pEnt);

    RestoreFeetAnimations(pEnt);
}

void AnimationFix::AntiFreestand()
{
    if (!c_config::get().aimbot_resolver)
        return;

    if (!Globals::LocalPlayer->IsAlive())
        return;

    if (!Globals::LocalPlayer->GetActiveWeapon() || Globals::LocalPlayer->IsKnifeorNade())
        return;


    for (int i = 1; i < g_pEngine->GetMaxClients(); ++i)
    {
        C_BaseEntity* pPlayerEntity = g_pEntityList->GetClientEntity(i);

        if (!pPlayerEntity
            || !pPlayerEntity->IsAlive()
            || pPlayerEntity->IsDormant()
            || pPlayerEntity == Globals::LocalPlayer
            || pPlayerEntity->GetTeam() == Globals::LocalPlayer->GetTeam())
        {
            UseFreestandAngle[i] = false;
            continue;
        }

        if (abs(pPlayerEntity->GetVelocity().Length2D()) > 29.f)
            UseFreestandAngle[pPlayerEntity->EntIndex()] = false;

        if (abs(pPlayerEntity->GetVelocity().Length2D()) <= 29.f && !UseFreestandAngle[pPlayerEntity->EntIndex()])
        {
            bool Autowalled = false, HitSide1 = false, HitSide2 = false;

            float angToLocal = g_Math.CalcAngle(Globals::LocalPlayer->GetOrigin(), pPlayerEntity->GetOrigin()).y;
            Vector ViewPoint = Globals::LocalPlayer->GetOrigin() + Vector(0, 0, 90);

            Vector2D Side1 = { (45 * sin(g_Math.GRD_TO_BOG(angToLocal))),(45 * cos(g_Math.GRD_TO_BOG(angToLocal))) };
            Vector2D Side2 = { (45 * sin(g_Math.GRD_TO_BOG(angToLocal + 180))) ,(45 * cos(g_Math.GRD_TO_BOG(angToLocal + 180))) };

            Vector2D Side3 = { (50 * sin(g_Math.GRD_TO_BOG(angToLocal))),(50 * cos(g_Math.GRD_TO_BOG(angToLocal))) };
            Vector2D Side4 = { (50 * sin(g_Math.GRD_TO_BOG(angToLocal + 180))) ,(50 * cos(g_Math.GRD_TO_BOG(angToLocal + 180))) };

            Vector Origin = pPlayerEntity->GetOrigin();

            Vector2D OriginLeftRight[] = { Vector2D(Side1.x, Side1.y), Vector2D(Side2.x, Side2.y) };

            Vector2D OriginLeftRightLocal[] = { Vector2D(Side3.x, Side3.y), Vector2D(Side4.x, Side4.y) };

            for (int side = 0; side < 2; side++)
            {
                Vector OriginAutowall = { Origin.x + OriginLeftRight[side].x,  Origin.y - OriginLeftRight[side].y , Origin.z + 90 };
                Vector OriginAutowall2 = { ViewPoint.x + OriginLeftRightLocal[side].x,  ViewPoint.y - OriginLeftRightLocal[side].y , ViewPoint.z };

                if (g_Autowall.CanHitFloatingPoint(OriginAutowall, ViewPoint))
                {
                    if (side == 0)
                    {
                        HitSide1 = true;
                        FreestandAngle[pPlayerEntity->EntIndex()] = 90;
                    }
                    else if (side == 1)
                    {
                        HitSide2 = true;
                        FreestandAngle[pPlayerEntity->EntIndex()] = -90;
                    }

                    Autowalled = true;
                }
                else
                {
                    for (int side222 = 0; side222 < 2; side222++)
                    {
                        Vector OriginAutowall222 = { Origin.x + OriginLeftRight[side222].x,  Origin.y - OriginLeftRight[side222].y , Origin.z + 90 };

                        if (g_Autowall.CanHitFloatingPoint(OriginAutowall222, OriginAutowall2))
                        {
                            if (side222 == 0)
                            {
                                HitSide1 = true;
                                FreestandAngle[pPlayerEntity->EntIndex()] = 90;
                            }
                            else if (side222 == 1)
                            {
                                HitSide2 = true;
                                FreestandAngle[pPlayerEntity->EntIndex()] = -90;
                            }

                            Autowalled = true;
                        }
                    }
                }
            }

            if (Autowalled)
            {
                if (HitSide1 && HitSide2)
                    UseFreestandAngle[pPlayerEntity->EntIndex()] = false;
                else
                    UseFreestandAngle[pPlayerEntity->EntIndex()] = true;
            }
        }
    }
}

void AnimationFix::Bruteforce(C_BaseEntity* pEnt)
{
    switch (Globals::MissedShots[pEnt->EntIndex()] % 6)
    {
    case 0:
        m_pData.m_pfGuessedAngle = m_pData.m_flLeftAbsYaw;
        break;
    case 1:
        m_pData.m_pfGuessedAngle = m_pData.m_flRightAbsYaw;
        break;
    case 2:
        m_pData.m_pfGuessedAngle = m_pData.m_flLeftAbsYaw;
        break;
    case 3:
        m_pData.m_pfGuessedAngle = m_pData.m_flRightAbsYaw;
        break;
    case 4:
        m_pData.m_pfGuessedAngle = m_pData.m_flLeftAbsYaw;
        break;
    case 5:
        m_pData.m_pfGuessedAngle = m_pData.m_flRightAbsYaw;
        break;
    case 6:
        m_pData.m_pfGuessedAngle = m_pData.m_flLeftAbsYaw;
        break;
    }
}

void AnimationFix::HandleHits(C_BaseEntity* pEnt)
{
    auto NetChannel = g_pEngine->GetNetChannelInfo();

    if (!NetChannel)
        return;

    static float predTime[65];
    static bool init[65];

    if (Globals::Shot[pEnt->EntIndex()])
    {
        if (init[pEnt->EntIndex()])
        {
            g_AnimationFix.pitchHit[pEnt->EntIndex()] = pEnt->GetEyeAngles().x;
            predTime[pEnt->EntIndex()] = g_pGlobalVars->curtime + NetChannel->GetAvgLatency(FLOW_INCOMING) + NetChannel->GetAvgLatency(FLOW_OUTGOING) + TICKS_TO_TIME(1) + TICKS_TO_TIME(g_pEngine->GetNetChannel()->m_nChokedPackets);
            init[pEnt->EntIndex()] = false;
        }

        if (g_pGlobalVars->curtime > predTime[pEnt->EntIndex()] && !Globals::Hit[pEnt->EntIndex()])
        {
            Globals::MissedShots[pEnt->EntIndex()] += 1;
            Globals::Shot[pEnt->EntIndex()] = false;
        }
        else if (g_pGlobalVars->curtime <= predTime[pEnt->EntIndex()] && Globals::Hit[pEnt->EntIndex()])
            Globals::Shot[pEnt->EntIndex()] = false;

    }
    else
        init[pEnt->EntIndex()] = true;

    Globals::Hit[pEnt->EntIndex()] = false;
}
ЧТО НАХУЙ?
1645639326048.png
 
Keep Ev0lving, Stay Fatal
Эксперт
Статус
Оффлайн
Регистрация
6 Фев 2018
Сообщения
1,550
Реакции[?]
585
Поинты[?]
101K
я вобще не понимаю нахрана это говно ты сюда закинул, фристент резольвер от (хуо гемини и ему падобных) матрикс резольвер без апореч ничтожен так моделька при спине может крутится по оси 360, куча разного не додела бл. за..... вы все говно постить сво... бомбит и еще на 23 февраля. AkatsukiSun ты зачем лайкнул ему это в миллион раз выкладывали и то было лучше.
Да так, кое что присмотрел и задумался для себя.
А так, в теме дефолт кода 110% из 100%.
10% как кэшбек.
 
Начинающий
Статус
Оффлайн
Регистрация
22 Сен 2018
Сообщения
32
Реакции[?]
38
Поинты[?]
4K
seems like a conglomerate of public code. boil it down more and it'd be fine honestly, dont know what these other snow monkeys are bitching about
 
На ваш бан.
Эксперт
Статус
Оффлайн
Регистрация
7 Дек 2020
Сообщения
1,453
Реакции[?]
434
Поинты[?]
36K
Мне интересно, под каждой темой с сурсами резольвера находится куча человек утверждающих что ресик говно полное, и так говорят будь-то лично кодили ресик скита, но вот почему тогда ни от одного из них нет чита с ресиком хотя бы на уровне нла?
 
Забаненный
Статус
Оффлайн
Регистрация
20 Фев 2022
Сообщения
149
Реакции[?]
41
Поинты[?]
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
спасибо, фикшу все
 
Нефор
Забаненный
Статус
Оффлайн
Регистрация
9 Ноя 2018
Сообщения
1,042
Реакции[?]
663
Поинты[?]
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Мне интересно, под каждой темой с сурсами резольвера находится куча человек утверждающих что ресик говно полное, и так говорят будь-то лично кодили ресик скита, но вот почему тогда ни от одного из них нет чита с ресиком хотя бы на уровне нла?
Я не думаю что кому то составит трудность сделать дефолт аф по дамагу и пасту би лайк вт, хватит думать что там ресольвер как то отличается от других п2к
 
get good get legendware
Участник
Статус
Оффлайн
Регистрация
22 Сен 2020
Сообщения
437
Реакции[?]
201
Поинты[?]
48K
I'm wondering, under each topic with resolver resources there are a bunch of people claiming that the resik is full of shit, and so they say whether they personally coded the skeet's resik, but then why is there no cheat with a resik at least at the NLA level from any of them?
if u think this is a normal resolver, i pity you
 
Escalation Project
Забаненный
Статус
Оффлайн
Регистрация
9 Май 2019
Сообщения
275
Реакции[?]
74
Поинты[?]
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
else if (!(m_pData.m_aServerLayers[12].m_flWeight * 1000.f))
че вы пристали к этому 12 лееру, господи, не трогайте ANIMATION_LAYER_LEAN, это WRONG!!!
ну будешь ты чекать лин в инверте, что тебе это даст?
шарклазер говорил, что 12 леер использовать не нужно.
используйте только 6!
 
Участник
Статус
Оффлайн
Регистрация
26 Апр 2018
Сообщения
851
Реакции[?]
181
Поинты[?]
0
Мне интересно, под каждой темой с сурсами резольвера находится куча человек утверждающих что ресик говно полное, и так говорят будь-то лично кодили ресик скита, но вот почему тогда ни от одного из них нет чита с ресиком хотя бы на уровне нла?
я тебя огорчу в резольвере нл ничего нормального нету тот же паблик только более клеар код и все, люди ни понимают выкладывают инфу 2018 года когда это говно удалили и переживали по 1000000000 раз, даже рабочую версию сливали и то потом убрали из за вопросов а как спастить да не как.
 
Пользователь
Статус
Оффлайн
Регистрация
26 Авг 2021
Сообщения
122
Реакции[?]
44
Поинты[?]
4K
Мне интересно, под каждой темой с сурсами резольвера находится куча человек утверждающих что ресик говно полное, и так говорят будь-то лично кодили ресик скита, но вот почему тогда ни от одного из них нет чита с ресиком хотя бы на уровне нла?
Здесь люди не утверждают, что рес хуйня и они сделают куда лучше, а просто указывают на банальные ошибки. Тут у создателя темы нет банальных знаний плюсов и движка.
Как сказал джастис, сделать обычный антифритенд и спиздить анимпарт с вантапа - вот вам блять обычный нормальный рес, но нет блять, мы добавим дохуя хуйни, которая вообще нахуй не нужна, 50 проверок, которые ничего дельного не проверяют и выкладывают этот ужас в ночи на юг.
И да, чтобы ваш чудо аним парт из вантапа качественно работал, нужно переделать анимфикс, пояснять я не буду, так как информации и тем была хуева туча
 
Сверху Снизу