Подведи собственные итоги года совместно с YOUGAME и забери ценные призы! Перейти

Вопрос Resolver xy0

kill me
Забаненный
Забаненный
Статус
Оффлайн
Регистрация
18 Дек 2018
Сообщения
365
Реакции
70
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Кто даст переделанный resolver под xy0 ?
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
вот вроде норм ресик для ху0
C++:
Expand Collapse Copy
Resolver g_Resolver;

/*
my attempt at fixing desync and i was pretty successful
it can resolve static desync pretty perfectly
and can resolve some jitter desync but
it still gets rekt by other things
*/

void Resolver::AnimationFix(C_BaseEntity* entity)
{
    entity->ClientAnimations(true);

    auto old_curtime = g_pGlobalVars->curtime;
    auto old_frametime = g_pGlobalVars->frametime;
    auto old_anim_overlay = entity->GetAnimOverlayy();

    g_pGlobalVars->curtime = entity->GetSimulationTime();
    g_pGlobalVars->frametime = g_pGlobalVars->intervalPerTick; // обновление анимации теперь будет происходит по тикам

    auto player_animation_state = entity->AnimState();
    auto player_model_time = reinterpret_cast<int*>(player_animation_state + 112);
    if (player_animation_state != nullptr && player_model_time != nullptr) // заставляем игру обновить анимации
        if (*player_model_time == g_pGlobalVars->framecount)
            *player_model_time = g_pGlobalVars->framecount - 1;

    entity->UpdateClientAnimation(); // обновление анимации
    entity->GetAnimOverlayy() = old_anim_overlay; // возвращаем серверные аним оверлеи
    matrix3x4_t matrix[128];
    entity->SetupBones(matrix, 128, 0x0007FF00 | 0x00000200, g_pGlobalVars->curtime);

    g_pGlobalVars->curtime = old_curtime;
    g_pGlobalVars->frametime = old_frametime;

    entity->ClientAnimations(false);
}

void enemy_anim_fix(C_BaseEntity* entity)
{
    auto state = entity->AnimState(); if (!state) return;
    auto index = entity->EntIndex();
    static float sim_time[65];

    if (sim_time[index] != entity->GetSimulationTime())
    {
        const float curtime = g_pGlobalVars->curtime;
        const float frametime = g_pGlobalVars->frametime;
        static auto host_timescale = g_pCvar->FindVar(("host_timescale"));

        g_pGlobalVars->frametime = g_pGlobalVars->intervalPerTick * host_timescale->GetFloat();
        g_pGlobalVars->curtime = entity->GetSimulationTime() + g_pGlobalVars->intervalPerTick;

        Vector backup_velocity = entity->GetVelocity();

        int backup_flags = entity->GetFlags();
        Vector abs = entity->GetAbsAngles();

        AnimationLayer backup_layers[15];
        std::memcpy(backup_layers, entity->AnimOverlays(), (sizeof(AnimationLayer) * 15));

        state->m_bOnGround ? backup_flags |= (1 << 0) : backup_flags &= ~(1 << 0);

        backup_flags &= ~0x1000;

        abs = entity->GetVelocity();
        abs = entity->GetVelocity();

        if (state->m_iLastClientSideAnimationUpdateFramecount == g_pGlobalVars->framecount)
            state->m_iLastClientSideAnimationUpdateFramecount = g_pGlobalVars->framecount - 1;

        entity->UpdateClientAnimation();
        float lby_delta = entity->GetLowerBodyYaw() - entity->GetEyeAngles().y;
        lby_delta = std::remainderf(lby_delta, 360.f);
        lby_delta = std::clamp(lby_delta, -60.f, 60.f);

        float feet_yaw = std::remainderf(entity->GetEyeAngles().y + lby_delta, 360.f);

        if (feet_yaw < 0.f) {
            feet_yaw += 360.f;
        }

        static float pitch, yaw = 0.f;

        entity->AnimState()->m_flGoalFeetYaw = entity->AnimState()->m_flCurrentFeetYaw = feet_yaw;

        std::memcpy(entity->AnimOverlays(), backup_layers, (sizeof(AnimationLayer) * 15));

        g_pGlobalVars->curtime = curtime;
        g_pGlobalVars->frametime = frametime;
        sim_time[index] = entity->GetSimulationTime();
    }

    // entity->InvalidateBoneCache();
    entity->SetupBones(nullptr, -1, 0x7FF00, g_pGlobalVars->curtime);
}



bool Resolver::enemy_is_slow_walking(C_BaseEntity* entity)
{
    C_BaseCombatWeapon* weapon = entity->GetActiveWeapon();
    if (!weapon)
        return false;

    float speed = entity->GetVelocity().Length2D();
    float get_gun = g_Resolver.get_gun(weapon);

    if (speed - get_gun < 34) // if it's more or less the same.
    {
        return true;
    }
    return false;
}
bool is_slow_walking(C_BaseEntity* entity) {
    float large = 0;
    float velocity_2D[64], old_velocity_2D[64];
    if (entity->GetVelocity().Length2D() != velocity_2D[entity->EntIndex()] && entity->GetVelocity().Length2D() != NULL) {
        old_velocity_2D[entity->EntIndex()] = velocity_2D[entity->EntIndex()];
        velocity_2D[entity->EntIndex()] = entity->GetVelocity().Length2D();
    }
    if (large == 0)return false;
    Vector velocity = entity->GetVelocity();
    Vector direction = entity->GetEyeAngles();

    float speed = velocity.Length();
    direction.y = entity->GetEyeAngles().y - direction.y;
    //method 1
    if (velocity_2D[entity->EntIndex()] > 1) {
        int tick_counter[64];
        if (velocity_2D[entity->EntIndex()] == old_velocity_2D[entity->EntIndex()])
            tick_counter[entity->EntIndex()] += 1;
        else
            tick_counter[entity->EntIndex()] = 0;

        while (tick_counter[entity->EntIndex()] > (1 / g_pGlobalVars->intervalPerTick) * fabsf(0.1f))//should give use 100ms in ticks if their speed stays the same for that long they are definetely up to something..
            return true;
    }


    return false;
}

float NormalizeYaw180(float yaw)
{
    if (yaw > 180)
        yaw -= (round(yaw / 360) * 360.f);
    else if (yaw < -180)
        yaw += (round(yaw / 360) * -360.f);

    return yaw;
}

void Resolver::LBY_FIX(C_BaseEntity* pEnt)
{



    int index = pEnt->EntIndex();
    static Vector Angle;
    Angle = pEnt->GetEyeAngles();
    AnimationLayer* anim = nullptr;

    static float moving_lby[65];
    static float moving_sim[65];
    static float stored_lby[65];
    static float old_lby[65];
    static float lby_delta[65];
    static float predicted_yaw[65];
    static bool lby_changes[65];
    static int shots_check[65];
    static float angle_brute[65];
    static float AtTargetAngle;
    static float FixPitch;
    static float FixPitch2;
    static bool HitNS[65];
    static Vector StoredAngle[65];
    static Vector Hitstored[65];
    static int StoredShots[65];
    static int HitShots[65];
    static int HitShotsStored[65];

    int Missedshots[65];

    if (stored_lby[index] != pEnt->GetLowerBodyYaw())
    {
        old_lby[index] = stored_lby[index];
        lby_changes[index] = true;
        stored_lby[index] = pEnt->GetLowerBodyYaw();
    }

    lby_delta[index] = NormalizeYaw180(stored_lby[index] - old_lby[index]);

    if (lby_changes[index])
    {
        if ((pEnt->GetSimulationTime() - moving_sim[index]) > .22f)
            predicted_yaw[index] = lby_delta[index];

        lby_changes[index] = false;
    }

    if (stored_lby[index] != pEnt->GetLowerBodyYaw())
    {
        old_lby[index] = stored_lby[index];
        Angle.y = pEnt->GetLowerBodyYaw();
        lby_changes[index] = true;
        stored_lby[index] = pEnt->GetLowerBodyYaw();
    }
    else if (abs(pEnt->GetVelocity().Length2D()) > 29.f && (pEnt->GetFlags() & FL_ONGROUND))
    {
        Angle.y = pEnt->GetLowerBodyYaw();
        moving_lby[index] = pEnt->GetLowerBodyYaw();
        moving_sim[index] = pEnt->GetSimulationTime();
        lby_changes[index] = false;
        predicted_yaw[index] = 0;
        Missedshots[index] = 0;
        angle_brute[index] = 0;
    }
    else if ((pEnt->GetFlags() & FL_ONGROUND))
    {
        if (shots_check[index] != Missedshots[index])
        {
            angle_brute[index] += predicted_yaw[index];
            shots_check[index] = Missedshots[index];
        }

        Angle.y = NormalizeYaw180(angle_brute[index] + moving_lby[index]);
    }
    else
    {
        Angle.y = pEnt->GetLowerBodyYaw();
    }

    pEnt->SetEyeAngles(Angle);

}

void 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_Resolver.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;
}

void Resolver::OnCreateMove() // cancer v2
{
    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;
            }
        }
    }
}

float AngleNormalize(float angle)
{
    angle = fmodf(angle, 360.0f);
    if (angle > 180)
    {
        angle -= 360;
    }
    if (angle < -180)
    {
        angle += 360;
    }
    return angle;
}

float max_desync_angle(C_BaseEntity* entity) {

    auto animstate = uintptr_t(entity->AnimState());

    float duckammount = *(float*)(animstate + 0xA4);
    float speedfraction = max(0, min(*reinterpret_cast<float*>(animstate + 0xF8), 1));

    float speedfactor = max(0, min(1, *reinterpret_cast<float*> (animstate + 0xFC)));

    float unk1 = ((*reinterpret_cast<float*> (animstate + 0x11C) * -0.30000001) - 0.19999999) * speedfraction;
    float unk2 = unk1 + 1.f;
    float unk3;

    if (duckammount > 0)
        unk2 += ((duckammount * speedfactor) * (0.5f - unk2));

    unk3 = *(float*)(animstate + 0x334) * unk2;

    return unk3;
}

bool delta_58(float first, float second)
{
    if (first - second < 58.f && first - second > -58.f)
    {
        return true;
    }
    return false;
}

float NormalizeYaw1801(float yaw)
{
    if (yaw > 180)
        yaw -= (round(yaw / 360) * 360.f);
    else if (yaw < -180)
        yaw += (round(yaw / 360) * -360.f);

    return yaw;
}

float angle_difference(float a, float b) {
    auto diff = NormalizeYaw1801(a - b);

    if (diff < 180)
        return diff;
    return diff - 360;
}

bool delta_35(float first, float second)
{
    if (first - second <= 35.f && first - second >= -35.f)
    {
        return true;
    }
    return false;
}

float approach(float cur, float target, float inc) {
    inc = abs(inc);

    if (cur < target)
        return min(cur + inc, target);
    if (cur > target)
        return max(cur - inc, target);

    return target;
}

float approach_angle(float cur, float target, float inc) {
    auto diff = angle_difference(target, cur);
    return approach(cur, cur + diff, inc);
}

float Resolver::get_gun(C_BaseCombatWeapon* weapon)
{

    if (!weapon)
        return 0.f;

    if (weapon->isAuto())
        return 40.f;

    else if (weapon->is_scout())
        return 70.f;

    else if (weapon->is_awp())
        return 30.f;

    else
        return 34.f;
}


bool solve_desync_simple(C_BaseEntity* e) // 979
{
    if (!e || e->IsDormant() || !e->IsAlive())
        return false;

    for (size_t i = 0; i < e->NumOverlays(); i++)
    {
        auto layer = e->get_anim_overlay_index(i);
        if (!layer)
            continue;

        if (e->get_sequence_act(layer->m_nSequence) == 979)
        {
            if (layer->m_flWeight == 0.0f && (layer->m_flCycle == 0.0f || layer->m_flCycle != layer->m_flPrevCycle))
                return true;
        }
    }
    return false;
}

void Resolver::resolveOldMethod(C_BaseEntity* player)
{
    auto local_player = Globals::LocalPlayer;

    if (!local_player)
        return;
    if (!c_config::get().resolve_old)
        return;



    if (!player)
        return;


    bool is_local_player = player == local_player;
    bool is_teammate = local_player->GetTeam() == player->GetTeam() && !is_local_player;

    if (is_local_player)
        return;

    if (is_teammate)
        return;

    if (player->GetHealth() <= 0)
        return;


    if (local_player->GetHealth() <= 0)
        return;

    auto idx = player->EntIndex();
    auto state = player->GetBasePlayerAnimState();
    auto lby = player->GetLowerBodyYaw();
    static float oldSimtimeShot[65];
    static float storedSimtimeShot[65];
    static float ShotTime[65];
    bool shot = false;
    Globals::enemyshot[idx] = false;


    if (storedSimtimeShot[idx] != player->GetSimulationTime())
    {
        if (player->GetActiveWeapon() && !player->IsKnifeorNade())
        {
            if (ShotTime[idx] != player->GetActiveWeapon()->GetLastShotTime())
            {
                shot = true;
                Globals::enemyshot[idx] = true;
                ShotTime[idx] = player->GetActiveWeapon()->GetLastShotTime();
            }
            else
            {
                shot = false;
                Globals::enemyshot[idx] = false;
            }
        }
        else
        {
            Globals::enemyshot[idx] = false;
            shot = false;
            ShotTime[idx] = 0.f;
        }

        oldSimtimeShot[idx] = storedSimtimeShot[idx];

        storedSimtimeShot[idx] = player->GetSimulationTime();
    }




    auto& record = _player[idx];

    if (state)
    {
        state->m_flEyeYaw = player->GetEyeAnglesXY()->y;
        state->m_flEyePitch = player->GetEyeAnglesXY()->x;
        player->setAnimationState(state);
    }

    if (state && state->speed_2d > 0.1f || fabs(state->flUpVelocity) > 100.0f)
    {
        state->m_flGoalFeetYaw = approach_angle(state->m_flEyeYaw, state->m_flGoalFeetYaw,
            ((state->m_flUnknownFraction * 20.0f) + 30.0f) * state->m_flLastClientSideAnimationUpdateTime);

        player->setAnimationState(state);
    }
    else
    {
        if (state)
        {
            state->m_flGoalFeetYaw = approach_angle(lby, state->m_flGoalFeetYaw,
                state->m_flLastClientSideAnimationUpdateTime * 100.0f);

            player->setAnimationState(state);
        }
    }

    record.current_tick.eyes = player->GetEyeAnglesXY()->y;

    if (record.current_tick.last_lby == FLT_MAX)
    {
        record.current_tick.last_lby = lby;
    }

    bool one = false;
    bool two = false;

    record.current_tick.lby_delta = record.current_tick.last_lby - lby;
    record.current_tick.eye_lby_delta = lby - record.current_tick.eyes;
    if (record.current_tick.last_lby != FLT_MAX)
    {
        if (player->GetVelocity().Length2D() > 0.1f)
        {
            if (record.current_tick.last_lby != lby)
                record.current_tick.last_lby = lby;

            one = false, two = false;
        }

        else
        {
            record.current_tick.lby_delta = record.current_tick.last_lby - lby;

            if (record.current_tick.last_lby != lby)
            {
                if (solve_desync_simple(player))
                {
                    if (delta_58(record.current_tick.last_lby, lby))
                    {
                        record.current_tick.low_delta = true;
                        record.current_tick.high_delta = false;
                    }
                    else
                    {
                        record.current_tick.low_delta = false;
                        record.current_tick.high_delta = true;
                    }

                    if (delta_58(lby, record.current_tick.eyes) && delta_58(record.current_tick.last_lby, record.current_tick.eyes))
                    {
                        if (!one || !two)
                            record.current_tick.jitter_desync = false;

                        if (one && two)
                            record.current_tick.jitter_desync = true;
                    }

                    if (record.current_tick.low_delta && !delta_58(record.current_tick.last_lby, record.current_tick.eyes))
                    {
                        if (!one)
                            one = true;

                        if (!two && one)
                            two = true;

                        if (one && two)
                            record.current_tick.jitter_desync = true;
                    }

                    //        else
                    //            record.current_tick.low_delta = true;
                }
                else
                    record.current_tick.static_desync = true;
            }
            else
            {
                if (!solve_desync_simple(player))
                {
                    one = false, two = false;

                    record.current_tick.static_desync = true;
                    record.current_tick.jitter_desync = false;

                }
                else
                {
                    if (!delta_58(record.current_tick.last_lby, record.current_tick.eyes))
                    {
                        record.current_tick.low_delta = false;
                        record.current_tick.high_delta = true;
                        record.current_tick.jitter_desync = true;
                    }
                    else
                    {
                        record.current_tick.low_delta = true;
                        record.current_tick.high_delta = false;
                        record.current_tick.jitter_desync = true;
                    }
                }
            }

        }
    }
    auto slow_walking = [&player]() -> bool
    {
        bool s = g_Resolver.enemy_is_slow_walking(player);

        if (s)
        {
            if (!(player->GetFlags() & FL_DUCKING))
            {
                g_Resolver.enemy_slowwalk = true;
                return true;
            }
            else
            {
                g_Resolver.enemy_slowwalk = false;
                return false;
            }
        }
        else
            return false;
    };
    if (slow_walking() && Globals::MissedShots[player->EntIndex()] >= 1)
    {
        Globals::enemyslow[player->EntIndex()] = true;
    }
    auto max_rotate = max_desync_angle(player);
    auto delta = angle_difference(player->GetEyeAnglesXY()->y, player->AnimState()->m_flCurrentFeetYaw);


    if (record.current_tick.low_delta && !record.current_tick.jitter_desync && record.current_tick.lby_delta < 58.f)
    {
        player->GetEyeAnglesXY()->y = record.current_tick.last_lby;
        Globals::rmode[player->EntIndex()] = 4;
    }

    else if (record.current_tick.jitter_desync && (!record.current_tick.high_delta || record.current_tick.low_delta))
    {
        // record.current_tick.eye_lby_delta

        player->GetEyeAnglesXY()->y = lby + (-record.current_tick.eye_lby_delta);
        Globals::rmode[player->EntIndex()] = 5;
    }

    else if (record.current_tick.jitter_desync && record.current_tick.high_delta)
    {
        player->GetEyeAnglesXY()->y = record.current_tick.last_lby;
        Globals::rmode[player->EntIndex()] = 6;
    }

    else if (record.current_tick.low_delta && record.current_tick.jitter_desync)
    {
        player->GetEyeAnglesXY()->y = lby - record.current_tick.lby_delta;
        Globals::rmode[player->EntIndex()] = 7;
    }

    else
    {
        if (delta < 35.f && delta > -35) {
            if (player->GetVelocity().Length2D() > 0.1f)
            {
                player->GetEyeAnglesXY()->y = player->GetLowerBodyYaw();
                Globals::rmode[player->EntIndex()] = 1;
            }
        }
        else if (delta > 35.f) {
            Globals::rmode[player->EntIndex()] = 2;
            if (player->GetEyeAnglesXY()->y < 0.f && player->GetEyeAnglesXY()->y > -180.f)
                player->GetEyeAnglesXY()->y = g_Math.NormalizeYaw(player->GetEyeAnglesXY()->y + delta);
            else if (player->GetEyeAnglesXY()->y > 0.f && player->GetEyeAnglesXY()->y < 180.f)
                player->GetEyeAnglesXY()->y = g_Math.NormalizeYaw(player->GetEyeAnglesXY()->y - delta);
        }
        else if (delta < -35.f) {
            Globals::rmode[player->EntIndex()] = 3;
            if (player->GetEyeAnglesXY()->y < 0.f && player->GetEyeAnglesXY()->y > -180.f)
                player->GetEyeAnglesXY()->y = g_Math.NormalizeYaw(player->GetEyeAnglesXY()->y - delta);
            else if (player->GetEyeAnglesXY()->y > 0.f && player->GetEyeAnglesXY()->y < 180.f)
                player->GetEyeAnglesXY()->y = g_Math.NormalizeYaw(player->GetEyeAnglesXY()->y + delta);
        }
        else
        {
            Globals::rmode[player->EntIndex()] = 9;
            auto player_animation_state = player->AnimState();
            float m_flLastClientSideAnimationUpdateTimeDelta = fabs(player_animation_state->m_iLastClientSideAnimationUpdateFramecount - player_animation_state->m_flLastClientSideAnimationUpdateTime);

            auto FeetSpeed = 0.f;

            if (player_animation_state->m_flFeetSpeedForwardsOrSideWays >= 0.0f)
            {
                FeetSpeed = fminf(player_animation_state->m_flFeetSpeedForwardsOrSideWays, 1.0f);
            }
            else
            {
                FeetSpeed = 0.0f;
            }

            float Fraction = ((player_animation_state->m_flStopToFullRunningFraction * -0.30000001) - 0.19999999) * FeetSpeed;

            float YawMod = Fraction + 1.0;

            if (player_animation_state->m_fDuckAmount > 0.0) // duck checks
            {
                float curfeet = 0.0f;

                if (player_animation_state->m_flFeetSpeedUnknownForwardOrSideways >= 0.0)
                {
                    curfeet = fminf(player_animation_state->m_flFeetSpeedUnknownForwardOrSideways, 1.0);
                }
                else
                {
                    curfeet = 0.0f;
                }
            }

            float flMaxYawModifier = player_animation_state->pad10[516] * YawMod;
            float flMinYawModifier = player_animation_state->pad10[512] * YawMod;

            float newFeetYaw = 0.f;

            auto eyeYaw = player_animation_state->m_flEyeYaw;

            auto lbyYaw = player_animation_state->m_flGoalFeetYaw;

            float eye_feet_delta = fabs(eyeYaw - lbyYaw);

            if (eye_feet_delta <= flMaxYawModifier) // SetupVelocity in help
            {
                if (flMinYawModifier > eye_feet_delta)
                {
                    newFeetYaw = fabs(flMinYawModifier) + eyeYaw;
                }
            }
            else
            {
                newFeetYaw = eyeYaw - fabs(flMaxYawModifier);
            }

            float EndYaw = fmod(newFeetYaw, 360.0);

            if (EndYaw > 180.0)
            {
                EndYaw = EndYaw - 360.0;
            }

            if (EndYaw < 180.0)
            {
                EndYaw = EndYaw + 360.0;
            }

            player_animation_state->m_flGoalFeetYaw = EndYaw;

        }
    }
}

void Resolver::resolve(C_BaseEntity* player)
{
    auto local_player = Globals::LocalPlayer;

    if (!local_player)
        return;
    if (!c_config::get().resolve_new)
        return;



    if (!player)
        return;


    bool is_local_player = player == local_player;
    bool is_teammate = local_player->GetTeam() == player->GetTeam() && !is_local_player;

    if (is_local_player)
        return;

    if (is_teammate)
        return;

    if (player->GetHealth() <= 0)
        return;


    if (local_player->GetHealth() <= 0)
        return;

    auto idx = player->EntIndex();
    auto state = player->GetBasePlayerAnimState();
    auto lby = player->GetLowerBodyYaw();
    static float oldSimtimeShot[65];
    static float storedSimtimeShot[65];
    static float ShotTime[65];
    bool shot = false;
    Globals::enemyshot[idx] = false;


    if (storedSimtimeShot[idx] != player->GetSimulationTime())
    {
        if (player->GetActiveWeapon() && !player->IsKnifeorNade())
        {
            if (ShotTime[idx] != player->GetActiveWeapon()->GetLastShotTime())
            {
                shot = true;
                Globals::enemyshot[idx] = true;
                ShotTime[idx] = player->GetActiveWeapon()->GetLastShotTime();
            }
            else
            {
                shot = false;
                Globals::enemyshot[idx] = false;
            }
        }
        else
        {
            Globals::enemyshot[idx] = false;
            shot = false;
            ShotTime[idx] = 0.f;
        }

        oldSimtimeShot[idx] = storedSimtimeShot[idx];

        storedSimtimeShot[idx] = player->GetSimulationTime();
    }




    auto& record = _player[idx];

    if (state)
    {
        state->m_flEyeYaw = player->GetEyeAnglesXY()->y;
        state->m_flEyePitch = player->GetEyeAnglesXY()->x;
        player->setAnimationState(state);
    }

    if (state && state->speed_2d > 0.1f || fabs(state->flUpVelocity) > 100.0f)
    {
        state->m_flGoalFeetYaw = approach_angle(state->m_flEyeYaw, state->m_flGoalFeetYaw,
            ((state->m_flUnknownFraction * 20.0f) + 30.0f) * state->m_flLastClientSideAnimationUpdateTime);

        player->setAnimationState(state);
    }
    else
    {
        if (state)
        {
            state->m_flGoalFeetYaw = approach_angle(lby, state->m_flGoalFeetYaw,
                state->m_flLastClientSideAnimationUpdateTime * 100.0f);

            player->setAnimationState(state);
        }
    }

    record.current_tick.eyes = player->GetEyeAnglesXY()->y;

    if (record.current_tick.last_lby == FLT_MAX)
    {
        record.current_tick.last_lby = lby;
    }

    bool one = false;
    bool two = false;

    record.current_tick.lby_delta = record.current_tick.last_lby - lby;
    record.current_tick.eye_lby_delta = lby - record.current_tick.eyes;
    if (record.current_tick.last_lby != FLT_MAX)
    {
        if (player->GetVelocity().Length2D() > 0.1f)
        {
            if (record.current_tick.last_lby != lby)
                record.current_tick.last_lby = lby;

            one = false, two = false;
        }

        else
        {
            record.current_tick.lby_delta = record.current_tick.last_lby - lby;

            if (record.current_tick.last_lby != lby)
            {
                if (solve_desync_simple(player))
                {
                    if (delta_58(record.current_tick.last_lby, lby))
                    {
                        record.current_tick.low_delta = true;
                        record.current_tick.high_delta = false;
                    }
                    else
                    {
                        record.current_tick.low_delta = false;
                        record.current_tick.high_delta = true;
                    }

                    if (delta_58(lby, record.current_tick.eyes) && delta_58(record.current_tick.last_lby, record.current_tick.eyes))
                    {
                        if (!one || !two)
                            record.current_tick.jitter_desync = false;

                        if (one && two)
                            record.current_tick.jitter_desync = true;
                    }

                    if (record.current_tick.low_delta && !delta_58(record.current_tick.last_lby, record.current_tick.eyes))
                    {
                        if (!one)
                            one = true;

                        if (!two && one)
                            two = true;

                        if (one && two)
                            record.current_tick.jitter_desync = true;
                    }

                    //        else
                    //            record.current_tick.low_delta = true;
                }
                else
                    record.current_tick.static_desync = true;
            }
            else
            {
                if (!solve_desync_simple(player))
                {
                    one = false, two = false;

                    record.current_tick.static_desync = true;
                    record.current_tick.jitter_desync = false;

                }
                else
                {
                    if (!delta_58(record.current_tick.last_lby, record.current_tick.eyes))
                    {
                        record.current_tick.low_delta = false;
                        record.current_tick.high_delta = true;
                        record.current_tick.jitter_desync = true;
                    }
                    else
                    {
                        record.current_tick.low_delta = true;
                        record.current_tick.high_delta = false;
                        record.current_tick.jitter_desync = true;
                    }
                }
            }

        }
    }
    auto slow_walking = [&player]() -> bool
    {
        bool s = g_Resolver.enemy_is_slow_walking(player);

        if (s)
        {
            if (!(player->GetFlags() & FL_DUCKING))
            {
                g_Resolver.enemy_slowwalk = true;
                return true;
            }
            else
            {
                g_Resolver.enemy_slowwalk = false;
                return false;
            }
        }
        else
            return false;
    };
    if (slow_walking() && Globals::MissedShots[player->EntIndex()] >= 1)
    {
        Globals::enemyslow[player->EntIndex()] = true;
    }
    auto max_rotate = max_desync_angle(player);
    auto delta = angle_difference(player->GetEyeAnglesXY()->y, player->AnimState()->m_flCurrentFeetYaw);


    if (record.current_tick.low_delta && !record.current_tick.jitter_desync && record.current_tick.lby_delta < 58.f)
    {
        player->GetEyeAnglesXY()->y = record.current_tick.last_lby;
        Globals::rmode[player->EntIndex()] = 4;
    }

    else if (record.current_tick.jitter_desync && (!record.current_tick.high_delta || record.current_tick.low_delta))
    {
        // record.current_tick.eye_lby_delta

        player->GetEyeAnglesXY()->y = lby + (-record.current_tick.eye_lby_delta);
        Globals::rmode[player->EntIndex()] = 5;
    }

    else if (record.current_tick.jitter_desync && record.current_tick.high_delta)
    {
        player->GetEyeAnglesXY()->y = record.current_tick.last_lby;
        Globals::rmode[player->EntIndex()] = 6;
    }

    else if (record.current_tick.low_delta && record.current_tick.jitter_desync)
    {
        player->GetEyeAnglesXY()->y = lby - record.current_tick.lby_delta;
        Globals::rmode[player->EntIndex()] = 7;
    }

    else
    {

        Globals::rmode[player->EntIndex()] = 9;
        auto player_animation_state = player->AnimState();
        float m_flLastClientSideAnimationUpdateTimeDelta = fabs(player_animation_state->m_iLastClientSideAnimationUpdateFramecount - player_animation_state->m_flLastClientSideAnimationUpdateTime);

        auto v48 = 0.f;

        if (player_animation_state->m_flFeetSpeedForwardsOrSideWays >= 0.0f)
        {
            v48 = fminf(player_animation_state->m_flFeetSpeedForwardsOrSideWays, 1.0f);
        }
        else
        {
            v48 = 0.0f;
        }

        float v49 = ((player_animation_state->m_flStopToFullRunningFraction * -0.30000001) - 0.19999999) * v48;

        float flYawModifier = v49 + 1.0;

        if (player_animation_state->m_fDuckAmount > 0.0)
        {
            float v53 = 0.0f;

            if (player_animation_state->m_flFeetSpeedUnknownForwardOrSideways >= 0.0)
            {
                v53 = fminf(player_animation_state->m_flFeetSpeedUnknownForwardOrSideways, 1.0);
            }
            else
            {
                v53 = 0.0f;
            }
        }

        float flMaxYawModifier = player_animation_state->pad10[516] * flYawModifier;
        float flMinYawModifier = player_animation_state->pad10[512] * flYawModifier;

        float newFeetYaw = 0.f;

        auto eyeYaw = player_animation_state->m_flEyeYaw;

        auto lbyYaw = player_animation_state->m_flGoalFeetYaw;

        float eye_feet_delta = fabs(eyeYaw - lbyYaw);

        if (eye_feet_delta <= flMaxYawModifier)
        {
            if (flMinYawModifier > eye_feet_delta)
            {
                newFeetYaw = fabs(flMinYawModifier) + eyeYaw;
            }
        }
        else
        {
            newFeetYaw = eyeYaw - fabs(flMaxYawModifier);
        }

        float v136 = fmod(newFeetYaw, 360.0);

        if (v136 > 180.0)
        {
            v136 = v136 - 360.0;
        }

        if (v136 < 180.0)
        {
            v136 = v136 + 360.0;
        }

        player_animation_state->m_flGoalFeetYaw = v136;


    }



}

void bruhResolver(C_BaseEntity* ent)
{
    if (!c_config::get().resolver_fix)
        return;

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

    auto animstate = ent->AnimState();
    auto v9 = (animstate->m_iLastClientSideAnimationUpdateFramecount - animstate->m_flLastClientSideAnimationUpdateTime);
    auto speedfraction = 0.0f;
    if (animstate->m_flFeetSpeedForwardsOrSideWays < 0.0f)
        speedfraction = 0.0f;
    else
        speedfraction = fminf(animstate->m_flFeetSpeedForwardsOrSideWays, 0x3F800000);
    auto v2 = (animstate->pad_0x0120() * -0.30000001 - 0.19999999) * speedfraction;
    auto v18 = v2;
    auto v3 = v2 + 1.0;
    auto v23 = v3;
    if (animstate->m_fDuckAmount > 0.0)
    {
        auto v29 = 0.0;
        if (animstate->m_flFeetSpeedUnknownForwardOrSideways < 0.0)
            v29 = 0.0;
        else
            v29 = fminf(animstate->m_flFeetSpeedUnknownForwardOrSideways, 0x3F800000);
    }
    auto localplayer_index = Globals::LocalPlayer->EntIndex();
    auto localplayer = Globals::LocalPlayer;
    if (localplayer)
    {
        auto fix_goal_feet_yaw = [](float rotation, float invertedrotation, float yawfeetdelta, float yaw, C_AnimState* state) // some shit i found on pastebin lol
        {
            if (yawfeetdelta < rotation)
            {
                if (invertedrotation > yawfeetdelta)
                    *(float*)(uintptr_t(state) + 0x80) = invertedrotation + yaw;
            }
            else
                *(float*)(uintptr_t(state) + 0x80) = yaw - rotation;
        };

        auto get_rotation = [&](int rotation_type, C_AnimState* state) {
            float v43 = *(float*)((uintptr_t)state + 0xA4);
            float v54 = max(0, min(*reinterpret_cast<float*>((uintptr_t)state + 0xF8), 1));
            float v55 = max(0, min(1, *reinterpret_cast<float*>((uintptr_t)state + 0xFC)));

            float v56;
            v56 = ((*reinterpret_cast<float*>((uintptr_t)state + 0x11C) * -0.30000001) - 0.19999999) * v54;
            if (v43 > 0)
                v56 += ((v43 * v55) * (0.5 - v56));

            v56 = *(float*)((uintptr_t)state + rotation_type) * v56;
            return v56;
        };
        float inverted = get_rotation(0x2B4, ent->AnimState());
        float max = get_rotation(0x2B0, ent->AnimState());
        float yawfeetdelta = ent->AnimState()->m_flEyeYaw - ent->AnimState()->m_flGoalFeetYaw;
        float yaw = ent->GetEyeAngles().y;
        //if (c_config::get().fixfeet)
            //fix_goal_feet_yaw(max, inverted, yawfeetdelta, yaw, ent->AnimState());
        float speed;
        if (*(float*)(animstate + 0xF8) < 0.f)
        {
            speed = 0.0;
        }
        else
        {
            speed = fminf(*(DWORD*)(animstate + 0xF8), 1.0f);
        }

        float flYawModifier = (*(float*)(animstate + 0x11C) * -0.30000001 - 0.19999999) * speed;
        flYawModifier += 1.0f;

        if (*(float*)(animstate + 0xA4) > 0.0 && *(float*)(animstate + 0xFC) >= 0.0)
            flYawModifier = fminf(*(float*)(uintptr_t(animstate) + 0xFC), 1.0f);

        float m_flMaxBodyYaw = *(float*)(uintptr_t(animstate) + 0x334) * flYawModifier;
        float m_flMinBodyYaw = *(float*)(uintptr_t(animstate) + 0x330) * flYawModifier;

        float ResolvedYaw = animstate->m_flEyeYaw;
        float delta = std::abs(animstate->m_flEyeYaw - animstate->m_flGoalFeetYaw);
        if (m_flMaxBodyYaw < delta)
        {
            ResolvedYaw = animstate->m_flEyeYaw - std::abs(m_flMaxBodyYaw);
        }
        else if (m_flMinBodyYaw > delta)
        {
            ResolvedYaw = animstate->m_flEyeYaw + std::abs(m_flMinBodyYaw);
        }
        auto player = ent;
        auto v8 = 0;
        auto v7 = 0;
        for (int a2a = 0; a2a < Globals::LocalPlayer->GetNumAnimOverlays(); ++a2a)
        {
            auto v32 = Globals::LocalPlayer->GetAnimOverlay4(a2a);
            if (v32)
                auto v6 = Globals::LocalPlayer;
        }
        auto v20 = animstate->flUpVelocity * v23;
        auto a1 = animstate->m_vVelocityY * v23;
        auto v30 = 0.0;
        auto eye_angles_y = animstate->m_flEyeYaw;
        auto goal_feet_yaw = animstate->m_flGoalFeetYaw;
        auto v22 = (eye_angles_y - goal_feet_yaw);
        if (v20 < v22)
        {
            auto v11 = v20;
            auto v30 = eye_angles_y - v11;
        }
        else if (a1 > v22)
        {
            auto v12 = a1;
            auto v30 = v12 + eye_angles_y;
        }
        float v36 = std::fmodf(v30, 360.0f);
        if (v36 > 180.0f)
            v36 = v36 - 360.0f;
        if (v36 < 180.0f)
            v36 = v36 + 360.0f;
        float inverse = 0 - v36;
        switch (Globals::MissedShot % 4)
        {
        case 0:
            animstate->m_flGoalFeetYaw = animstate->m_flGoalFeetYaw + 45.0;
            break;
        case 1:
            animstate->m_flGoalFeetYaw = animstate->m_flGoalFeetYaw - 45.0;
            break;
        case 2:
            animstate->m_flGoalFeetYaw = animstate->m_flGoalFeetYaw - 30.0;
            break;
        case 3:
            animstate->m_flGoalFeetYaw = animstate->m_flGoalFeetYaw + 30.0;
            break;
        case 4:
            animstate->m_flGoalFeetYaw = animstate->m_flGoalFeetYaw - 89.0;
            break;
        case 5:
            animstate->m_flGoalFeetYaw = animstate->m_flGoalFeetYaw + 89.0;
            break;
        case 6:
            animstate->m_flGoalFeetYaw = animstate->m_flGoalFeetYaw - 116.0;
            break;
        case 7:
            animstate->m_flGoalFeetYaw = animstate->m_flGoalFeetYaw + 116.0;
            break;

        }
        switch (Globals::MissedShot % 3)
        {
        case 0:
            ent->SetAbsAngles(Vector(0, v36, 0));
            break;
        case 1:
            ent->SetAbsAngles(Vector(0, inverse, 0));
            break;
        case 2:
            ent->SetAbsAngles(Vector(0, AngleNormalize(ResolvedYaw), 0));
            break;
        }
    }
}

void FixPitch(C_BaseEntity* pEnt)
{
    float last_simtime[64] = { 0.f };
    float stored_pitch_1[64] = { 0.f };
    float fixed_pitch[64] = { 0.f };
    int to_spread_in_resolver[64];

    bool has_been_set[64] = { false };

    const auto local = Globals::LocalPlayer;
    if (!local)
        return;
    if (!c_config::get().pitch_resolver)
        return;
    for (auto i = 0; i < g_pEngine->GetMaxClients(); ++i)
    {

        const auto eye = pEnt->GetEyeAnglesXY();

        auto pitch = 0.f;

        if (stored_pitch_1[i] == FLT_MAX || !has_been_set[i])
        {
            stored_pitch_1[i] = eye->x;
            has_been_set[i] = true;
        }

        if (stored_pitch_1[i] - eye->x < 30 && stored_pitch_1[i] - eye->x > -30)
        {
            pitch = eye->x;
        }
        else
        {
            pitch = stored_pitch_1[i];
        }

        pEnt->GetEyeAnglesXY()->x = pitch;
    }
}

Vector GetSmoothedVelocity1(float min_delta, Vector a, Vector b) {
    Vector delta = a - b;
    float delta_length = delta.Length();

    if (delta_length <= min_delta) {
        Vector result;
        if (-min_delta <= delta_length) {
            return a;
        }
        else {
            float iradius = 1.0f / (delta_length + FLT_EPSILON);
            return b - ((delta * iradius) * min_delta);
        }
    }
    else {
        float iradius = 1.0f / (delta_length + FLT_EPSILON);
        return b + ((delta * iradius) * min_delta);
    }
}

float Resolver::approach(float cur, float target, float inc) {
    inc = abs(inc);

    if (cur < target)
        return min(cur + inc, target);
    if (cur > target)
        return max(cur - inc, target);

    return target;
}

float Resolver::approach_angle(float cur, float target, float inc) {
    auto diff = angle_difference(target, cur);
    return approach(cur, cur + diff, inc);
}

Vector GetSmoothedVelocity(float min_delta, Vector a, Vector b) {
    Vector delta = a - b;
    float delta_length = delta.Length();

    if (delta_length <= min_delta) {
        Vector result;
        if (-min_delta <= delta_length) {
            return a;
        }
        else {
            float iradius = 1.0f / (delta_length + FLT_EPSILON);
            return b - ((delta * iradius) * min_delta);
        }
    }
    else {
        float iradius = 1.0f / (delta_length + FLT_EPSILON);
        return b + ((delta * iradius) * min_delta);
    }
}

void resolve1(C_BaseEntity* ent)
{
    if (!c_config::get().aimbot_resolver)
        return;

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

    if (ent != Globals::LocalPlayer)
        enemy_anim_fix(ent);

    auto animState = ent->AnimState();

    static auto GetSmoothedVelocity = [](float min_delta, Vector a, Vector b) {
        Vector delta = a - b;
        float delta_length = delta.Length();

        if (delta_length <= min_delta) {
            Vector result;
            if (-min_delta <= delta_length) {
                return a;
            }
            else {
                float iradius = 1.0f / (delta_length + FLT_EPSILON);
                return b - ((delta * iradius) * min_delta);
            }
        }
        else {
            float iradius = 1.0f / (delta_length + FLT_EPSILON);
            return b + ((delta * iradius) * min_delta);
        }
    };
    float v25;
    v25 = std::clamp(animState->m_fLandingDuckAdditiveSomething + ent->m_flDuckAmount(), 1.0f, 0.0f);
    float v32;
    v32 = ent->GetSimulationTime() - ent->GetOldSimulationTime();
    float v26 = animState->m_fDuckAmount;
    float v27 = v32 * 6.0f;
    float v28;

    // clamp
    if ((v25 - v26) <= v27) {
        if (-v27 <= (v25 - v26))
            v28 = v25;
        else
            v28 = v26 - v27;
    }
    else {
        v28 = v26 + v27;
    }

    Vector velocity = ent->GetVelocity();
    float flDuckAmount = std::clamp(v28, 1.0f, 0.0f);

    Vector animationVelocity = GetSmoothedVelocity1(v32 * 2000.0f, velocity, animState->m_flVelocity());
    float speed = std::fminf(animationVelocity.Length(), 260.0f);

    auto weapon = (WeaponInfo_t*)Globals::LocalPlayer->GetActiveWeapon();

    float flMaxMovementSpeed = 260.0f;
    if (weapon) {
        flMaxMovementSpeed = std::fmaxf(weapon->max_speed, 0.001f);
    }

    float flRunningSpeed = speed / (flMaxMovementSpeed * 0.520f);
    float flDuckingSpeed = speed / (flMaxMovementSpeed * 0.340f);

    flRunningSpeed = std::clamp(flRunningSpeed, 0.0f, 1.0f);

    float flYawModifier = (((*(float*)(uintptr_t(animState) + 0x11c) * -0.3f) - 0.2f) * flRunningSpeed) + 1.0f;
    if (flDuckAmount > 0.0f) {
        float flDuckingSpeed = std::clamp(flDuckingSpeed, 0.0f, 1.0f);
        flYawModifier += (flDuckAmount * flDuckingSpeed) * (0.5f - flYawModifier);
    }

    float m_flMaxBodyYaw = *(float*)(uintptr_t(animState) + 0x334) * flYawModifier;
    float m_flMinBodyYaw = *(float*)(uintptr_t(animState) + 0x330) * flYawModifier;

    float flEyeYaw = ent->GetEyeAngles().y;
    float flEyeDiff = std::remainderf(flEyeYaw - g_Resolver.resolverinfoo.fakegoalfeetyaw, 360.f);

    if (flEyeDiff <= m_flMaxBodyYaw) {
        if (m_flMinBodyYaw > flEyeDiff)
            g_Resolver.resolverinfoo.fakegoalfeetyaw = fabs(m_flMinBodyYaw) + flEyeYaw;
    }
    else {
        g_Resolver.resolverinfoo.fakegoalfeetyaw = flEyeYaw - fabs(m_flMaxBodyYaw);
    }

    g_Resolver.resolverinfoo.fakegoalfeetyaw = std::remainderf(g_Resolver.resolverinfoo.fakegoalfeetyaw, 360.f);

    if (speed > 0.1f || fabs(velocity.z) > 100.0f) {
        g_Resolver.resolverinfoo.fakegoalfeetyaw = g_Resolver.approach_angle(
            flEyeYaw,
            g_Resolver.resolverinfoo.fakegoalfeetyaw,
            ((*(float*)(uintptr_t(animState) + 0x11c) * 20.0f) + 30.0f)
            * v32);
    }
    else {
        g_Resolver.resolverinfoo.fakegoalfeetyaw = g_Resolver.approach_angle(
            ent->GetLowerBodyYaw(),
            g_Resolver.resolverinfoo.fakegoalfeetyaw,
            v32 * 100.0f);
    }

    float Left = flEyeYaw - m_flMinBodyYaw;
    float Right = flEyeYaw - m_flMaxBodyYaw;

    float resolveYaw;
    switch (Globals::MissedShots[ent->EntIndex()] % 2)
    {
    case 0:
        resolveYaw = Left;
        break;
    case 1:
        resolveYaw = Right;
        break;
    }
    animState->m_flGoalFeetYaw = resolveYaw;
}


void Resolver::FrameStage(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())
            continue;
        if (pPlayerEntity->IsDormant())
        {
            wasDormant[i] = true;
            continue;
        }

        if (stage == FRAME_RENDER_START)
        {
            HandleHits(pPlayerEntity);
            AnimationFix(pPlayerEntity);
            /*if (c_config::get().lby_fix && pPlayerEntity != Globals::LocalPlayer) {
                LBY_FIX(pPlayerEntity);
            }
            if (c_config::get().resolver_fix && pPlayerEntity != Globals::LocalPlayer) {
                bruhResolver(pPlayerEntity);
            }
            if (c_config::get().pitch_resolver && pPlayerEntity != Globals::LocalPlayer) {
                FixPitch(pPlayerEntity);
            }
            if (c_config::get().resolve_old && pPlayerEntity != Globals::LocalPlayer) {
                resolveOldMethod(pPlayerEntity);
            }
            if (c_config::get().resolve_new && pPlayerEntity != Globals::LocalPlayer) {
                resolve(pPlayerEntity);
            }*/
            if (c_config::get().aimbot_resolver1)
            {
                if (pPlayerEntity != Globals::LocalPlayer)
                    resolve1(pPlayerEntity);

                if (pPlayerEntity != Globals::LocalPlayer)
                    pPlayerEntity->UpdateClientAnimation();
            }
        }

        if (stage == FRAME_NET_UPDATE_END && pPlayerEntity != Globals::LocalPlayer)
        {
            auto VarMap = reinterpret_cast<uintptr_t>(pPlayerEntity) + 36;
            auto VarMapSize = *reinterpret_cast<int*>(VarMap + 20);

            for (auto index = 0; index < VarMapSize; index++)
                *reinterpret_cast<uintptr_t*>(*reinterpret_cast<uintptr_t*>(VarMap) + index * 12) = 0;
        }

        wasDormant[i] = false;
    }
}
что то да могет, сам играл
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
вот вроде норм ресик для ху0
C++:
Expand Collapse Copy
Resolver g_Resolver;

/*
my attempt at fixing desync and i was pretty successful
it can resolve static desync pretty perfectly
and can resolve some jitter desync but
it still gets rekt by other things
*/

void Resolver::AnimationFix(C_BaseEntity* entity)
{
    entity->ClientAnimations(true);

    auto old_curtime = g_pGlobalVars->curtime;
    auto old_frametime = g_pGlobalVars->frametime;
    auto old_anim_overlay = entity->GetAnimOverlayy();

    g_pGlobalVars->curtime = entity->GetSimulationTime();
    g_pGlobalVars->frametime = g_pGlobalVars->intervalPerTick; // обновление анимации теперь будет происходит по тикам

    auto player_animation_state = entity->AnimState();
    auto player_model_time = reinterpret_cast<int*>(player_animation_state + 112);
    if (player_animation_state != nullptr && player_model_time != nullptr) // заставляем игру обновить анимации
        if (*player_model_time == g_pGlobalVars->framecount)
            *player_model_time = g_pGlobalVars->framecount - 1;

    entity->UpdateClientAnimation(); // обновление анимации
    entity->GetAnimOverlayy() = old_anim_overlay; // возвращаем серверные аним оверлеи
    matrix3x4_t matrix[128];
    entity->SetupBones(matrix, 128, 0x0007FF00 | 0x00000200, g_pGlobalVars->curtime);

    g_pGlobalVars->curtime = old_curtime;
    g_pGlobalVars->frametime = old_frametime;

    entity->ClientAnimations(false);
}

void enemy_anim_fix(C_BaseEntity* entity)
{
    auto state = entity->AnimState(); if (!state) return;
    auto index = entity->EntIndex();
    static float sim_time[65];

    if (sim_time[index] != entity->GetSimulationTime())
    {
        const float curtime = g_pGlobalVars->curtime;
        const float frametime = g_pGlobalVars->frametime;
        static auto host_timescale = g_pCvar->FindVar(("host_timescale"));

        g_pGlobalVars->frametime = g_pGlobalVars->intervalPerTick * host_timescale->GetFloat();
        g_pGlobalVars->curtime = entity->GetSimulationTime() + g_pGlobalVars->intervalPerTick;

        Vector backup_velocity = entity->GetVelocity();

        int backup_flags = entity->GetFlags();
        Vector abs = entity->GetAbsAngles();

        AnimationLayer backup_layers[15];
        std::memcpy(backup_layers, entity->AnimOverlays(), (sizeof(AnimationLayer) * 15));

        state->m_bOnGround ? backup_flags |= (1 << 0) : backup_flags &= ~(1 << 0);

        backup_flags &= ~0x1000;

        abs = entity->GetVelocity();
        abs = entity->GetVelocity();

        if (state->m_iLastClientSideAnimationUpdateFramecount == g_pGlobalVars->framecount)
            state->m_iLastClientSideAnimationUpdateFramecount = g_pGlobalVars->framecount - 1;

        entity->UpdateClientAnimation();
        float lby_delta = entity->GetLowerBodyYaw() - entity->GetEyeAngles().y;
        lby_delta = std::remainderf(lby_delta, 360.f);
        lby_delta = std::clamp(lby_delta, -60.f, 60.f);

        float feet_yaw = std::remainderf(entity->GetEyeAngles().y + lby_delta, 360.f);

        if (feet_yaw < 0.f) {
            feet_yaw += 360.f;
        }

        static float pitch, yaw = 0.f;

        entity->AnimState()->m_flGoalFeetYaw = entity->AnimState()->m_flCurrentFeetYaw = feet_yaw;

        std::memcpy(entity->AnimOverlays(), backup_layers, (sizeof(AnimationLayer) * 15));

        g_pGlobalVars->curtime = curtime;
        g_pGlobalVars->frametime = frametime;
        sim_time[index] = entity->GetSimulationTime();
    }

    // entity->InvalidateBoneCache();
    entity->SetupBones(nullptr, -1, 0x7FF00, g_pGlobalVars->curtime);
}



bool Resolver::enemy_is_slow_walking(C_BaseEntity* entity)
{
    C_BaseCombatWeapon* weapon = entity->GetActiveWeapon();
    if (!weapon)
        return false;

    float speed = entity->GetVelocity().Length2D();
    float get_gun = g_Resolver.get_gun(weapon);

    if (speed - get_gun < 34) // if it's more or less the same.
    {
        return true;
    }
    return false;
}
bool is_slow_walking(C_BaseEntity* entity) {
    float large = 0;
    float velocity_2D[64], old_velocity_2D[64];
    if (entity->GetVelocity().Length2D() != velocity_2D[entity->EntIndex()] && entity->GetVelocity().Length2D() != NULL) {
        old_velocity_2D[entity->EntIndex()] = velocity_2D[entity->EntIndex()];
        velocity_2D[entity->EntIndex()] = entity->GetVelocity().Length2D();
    }
    if (large == 0)return false;
    Vector velocity = entity->GetVelocity();
    Vector direction = entity->GetEyeAngles();

    float speed = velocity.Length();
    direction.y = entity->GetEyeAngles().y - direction.y;
    //method 1
    if (velocity_2D[entity->EntIndex()] > 1) {
        int tick_counter[64];
        if (velocity_2D[entity->EntIndex()] == old_velocity_2D[entity->EntIndex()])
            tick_counter[entity->EntIndex()] += 1;
        else
            tick_counter[entity->EntIndex()] = 0;

        while (tick_counter[entity->EntIndex()] > (1 / g_pGlobalVars->intervalPerTick) * fabsf(0.1f))//should give use 100ms in ticks if their speed stays the same for that long they are definetely up to something..
            return true;
    }


    return false;
}

float NormalizeYaw180(float yaw)
{
    if (yaw > 180)
        yaw -= (round(yaw / 360) * 360.f);
    else if (yaw < -180)
        yaw += (round(yaw / 360) * -360.f);

    return yaw;
}

void Resolver::LBY_FIX(C_BaseEntity* pEnt)
{



    int index = pEnt->EntIndex();
    static Vector Angle;
    Angle = pEnt->GetEyeAngles();
    AnimationLayer* anim = nullptr;

    static float moving_lby[65];
    static float moving_sim[65];
    static float stored_lby[65];
    static float old_lby[65];
    static float lby_delta[65];
    static float predicted_yaw[65];
    static bool lby_changes[65];
    static int shots_check[65];
    static float angle_brute[65];
    static float AtTargetAngle;
    static float FixPitch;
    static float FixPitch2;
    static bool HitNS[65];
    static Vector StoredAngle[65];
    static Vector Hitstored[65];
    static int StoredShots[65];
    static int HitShots[65];
    static int HitShotsStored[65];

    int Missedshots[65];

    if (stored_lby[index] != pEnt->GetLowerBodyYaw())
    {
        old_lby[index] = stored_lby[index];
        lby_changes[index] = true;
        stored_lby[index] = pEnt->GetLowerBodyYaw();
    }

    lby_delta[index] = NormalizeYaw180(stored_lby[index] - old_lby[index]);

    if (lby_changes[index])
    {
        if ((pEnt->GetSimulationTime() - moving_sim[index]) > .22f)
            predicted_yaw[index] = lby_delta[index];

        lby_changes[index] = false;
    }

    if (stored_lby[index] != pEnt->GetLowerBodyYaw())
    {
        old_lby[index] = stored_lby[index];
        Angle.y = pEnt->GetLowerBodyYaw();
        lby_changes[index] = true;
        stored_lby[index] = pEnt->GetLowerBodyYaw();
    }
    else if (abs(pEnt->GetVelocity().Length2D()) > 29.f && (pEnt->GetFlags() & FL_ONGROUND))
    {
        Angle.y = pEnt->GetLowerBodyYaw();
        moving_lby[index] = pEnt->GetLowerBodyYaw();
        moving_sim[index] = pEnt->GetSimulationTime();
        lby_changes[index] = false;
        predicted_yaw[index] = 0;
        Missedshots[index] = 0;
        angle_brute[index] = 0;
    }
    else if ((pEnt->GetFlags() & FL_ONGROUND))
    {
        if (shots_check[index] != Missedshots[index])
        {
            angle_brute[index] += predicted_yaw[index];
            shots_check[index] = Missedshots[index];
        }

        Angle.y = NormalizeYaw180(angle_brute[index] + moving_lby[index]);
    }
    else
    {
        Angle.y = pEnt->GetLowerBodyYaw();
    }

    pEnt->SetEyeAngles(Angle);

}

void 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_Resolver.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;
}

void Resolver::OnCreateMove() // cancer v2
{
    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;
            }
        }
    }
}

float AngleNormalize(float angle)
{
    angle = fmodf(angle, 360.0f);
    if (angle > 180)
    {
        angle -= 360;
    }
    if (angle < -180)
    {
        angle += 360;
    }
    return angle;
}

float max_desync_angle(C_BaseEntity* entity) {

    auto animstate = uintptr_t(entity->AnimState());

    float duckammount = *(float*)(animstate + 0xA4);
    float speedfraction = max(0, min(*reinterpret_cast<float*>(animstate + 0xF8), 1));

    float speedfactor = max(0, min(1, *reinterpret_cast<float*> (animstate + 0xFC)));

    float unk1 = ((*reinterpret_cast<float*> (animstate + 0x11C) * -0.30000001) - 0.19999999) * speedfraction;
    float unk2 = unk1 + 1.f;
    float unk3;

    if (duckammount > 0)
        unk2 += ((duckammount * speedfactor) * (0.5f - unk2));

    unk3 = *(float*)(animstate + 0x334) * unk2;

    return unk3;
}

bool delta_58(float first, float second)
{
    if (first - second < 58.f && first - second > -58.f)
    {
        return true;
    }
    return false;
}

float NormalizeYaw1801(float yaw)
{
    if (yaw > 180)
        yaw -= (round(yaw / 360) * 360.f);
    else if (yaw < -180)
        yaw += (round(yaw / 360) * -360.f);

    return yaw;
}

float angle_difference(float a, float b) {
    auto diff = NormalizeYaw1801(a - b);

    if (diff < 180)
        return diff;
    return diff - 360;
}

bool delta_35(float first, float second)
{
    if (first - second <= 35.f && first - second >= -35.f)
    {
        return true;
    }
    return false;
}

float approach(float cur, float target, float inc) {
    inc = abs(inc);

    if (cur < target)
        return min(cur + inc, target);
    if (cur > target)
        return max(cur - inc, target);

    return target;
}

float approach_angle(float cur, float target, float inc) {
    auto diff = angle_difference(target, cur);
    return approach(cur, cur + diff, inc);
}

float Resolver::get_gun(C_BaseCombatWeapon* weapon)
{

    if (!weapon)
        return 0.f;

    if (weapon->isAuto())
        return 40.f;

    else if (weapon->is_scout())
        return 70.f;

    else if (weapon->is_awp())
        return 30.f;

    else
        return 34.f;
}


bool solve_desync_simple(C_BaseEntity* e) // 979
{
    if (!e || e->IsDormant() || !e->IsAlive())
        return false;

    for (size_t i = 0; i < e->NumOverlays(); i++)
    {
        auto layer = e->get_anim_overlay_index(i);
        if (!layer)
            continue;

        if (e->get_sequence_act(layer->m_nSequence) == 979)
        {
            if (layer->m_flWeight == 0.0f && (layer->m_flCycle == 0.0f || layer->m_flCycle != layer->m_flPrevCycle))
                return true;
        }
    }
    return false;
}

void Resolver::resolveOldMethod(C_BaseEntity* player)
{
    auto local_player = Globals::LocalPlayer;

    if (!local_player)
        return;
    if (!c_config::get().resolve_old)
        return;



    if (!player)
        return;


    bool is_local_player = player == local_player;
    bool is_teammate = local_player->GetTeam() == player->GetTeam() && !is_local_player;

    if (is_local_player)
        return;

    if (is_teammate)
        return;

    if (player->GetHealth() <= 0)
        return;


    if (local_player->GetHealth() <= 0)
        return;

    auto idx = player->EntIndex();
    auto state = player->GetBasePlayerAnimState();
    auto lby = player->GetLowerBodyYaw();
    static float oldSimtimeShot[65];
    static float storedSimtimeShot[65];
    static float ShotTime[65];
    bool shot = false;
    Globals::enemyshot[idx] = false;


    if (storedSimtimeShot[idx] != player->GetSimulationTime())
    {
        if (player->GetActiveWeapon() && !player->IsKnifeorNade())
        {
            if (ShotTime[idx] != player->GetActiveWeapon()->GetLastShotTime())
            {
                shot = true;
                Globals::enemyshot[idx] = true;
                ShotTime[idx] = player->GetActiveWeapon()->GetLastShotTime();
            }
            else
            {
                shot = false;
                Globals::enemyshot[idx] = false;
            }
        }
        else
        {
            Globals::enemyshot[idx] = false;
            shot = false;
            ShotTime[idx] = 0.f;
        }

        oldSimtimeShot[idx] = storedSimtimeShot[idx];

        storedSimtimeShot[idx] = player->GetSimulationTime();
    }




    auto& record = _player[idx];

    if (state)
    {
        state->m_flEyeYaw = player->GetEyeAnglesXY()->y;
        state->m_flEyePitch = player->GetEyeAnglesXY()->x;
        player->setAnimationState(state);
    }

    if (state && state->speed_2d > 0.1f || fabs(state->flUpVelocity) > 100.0f)
    {
        state->m_flGoalFeetYaw = approach_angle(state->m_flEyeYaw, state->m_flGoalFeetYaw,
            ((state->m_flUnknownFraction * 20.0f) + 30.0f) * state->m_flLastClientSideAnimationUpdateTime);

        player->setAnimationState(state);
    }
    else
    {
        if (state)
        {
            state->m_flGoalFeetYaw = approach_angle(lby, state->m_flGoalFeetYaw,
                state->m_flLastClientSideAnimationUpdateTime * 100.0f);

            player->setAnimationState(state);
        }
    }

    record.current_tick.eyes = player->GetEyeAnglesXY()->y;

    if (record.current_tick.last_lby == FLT_MAX)
    {
        record.current_tick.last_lby = lby;
    }

    bool one = false;
    bool two = false;

    record.current_tick.lby_delta = record.current_tick.last_lby - lby;
    record.current_tick.eye_lby_delta = lby - record.current_tick.eyes;
    if (record.current_tick.last_lby != FLT_MAX)
    {
        if (player->GetVelocity().Length2D() > 0.1f)
        {
            if (record.current_tick.last_lby != lby)
                record.current_tick.last_lby = lby;

            one = false, two = false;
        }

        else
        {
            record.current_tick.lby_delta = record.current_tick.last_lby - lby;

            if (record.current_tick.last_lby != lby)
            {
                if (solve_desync_simple(player))
                {
                    if (delta_58(record.current_tick.last_lby, lby))
                    {
                        record.current_tick.low_delta = true;
                        record.current_tick.high_delta = false;
                    }
                    else
                    {
                        record.current_tick.low_delta = false;
                        record.current_tick.high_delta = true;
                    }

                    if (delta_58(lby, record.current_tick.eyes) && delta_58(record.current_tick.last_lby, record.current_tick.eyes))
                    {
                        if (!one || !two)
                            record.current_tick.jitter_desync = false;

                        if (one && two)
                            record.current_tick.jitter_desync = true;
                    }

                    if (record.current_tick.low_delta && !delta_58(record.current_tick.last_lby, record.current_tick.eyes))
                    {
                        if (!one)
                            one = true;

                        if (!two && one)
                            two = true;

                        if (one && two)
                            record.current_tick.jitter_desync = true;
                    }

                    //        else
                    //            record.current_tick.low_delta = true;
                }
                else
                    record.current_tick.static_desync = true;
            }
            else
            {
                if (!solve_desync_simple(player))
                {
                    one = false, two = false;

                    record.current_tick.static_desync = true;
                    record.current_tick.jitter_desync = false;

                }
                else
                {
                    if (!delta_58(record.current_tick.last_lby, record.current_tick.eyes))
                    {
                        record.current_tick.low_delta = false;
                        record.current_tick.high_delta = true;
                        record.current_tick.jitter_desync = true;
                    }
                    else
                    {
                        record.current_tick.low_delta = true;
                        record.current_tick.high_delta = false;
                        record.current_tick.jitter_desync = true;
                    }
                }
            }

        }
    }
    auto slow_walking = [&player]() -> bool
    {
        bool s = g_Resolver.enemy_is_slow_walking(player);

        if (s)
        {
            if (!(player->GetFlags() & FL_DUCKING))
            {
                g_Resolver.enemy_slowwalk = true;
                return true;
            }
            else
            {
                g_Resolver.enemy_slowwalk = false;
                return false;
            }
        }
        else
            return false;
    };
    if (slow_walking() && Globals::MissedShots[player->EntIndex()] >= 1)
    {
        Globals::enemyslow[player->EntIndex()] = true;
    }
    auto max_rotate = max_desync_angle(player);
    auto delta = angle_difference(player->GetEyeAnglesXY()->y, player->AnimState()->m_flCurrentFeetYaw);


    if (record.current_tick.low_delta && !record.current_tick.jitter_desync && record.current_tick.lby_delta < 58.f)
    {
        player->GetEyeAnglesXY()->y = record.current_tick.last_lby;
        Globals::rmode[player->EntIndex()] = 4;
    }

    else if (record.current_tick.jitter_desync && (!record.current_tick.high_delta || record.current_tick.low_delta))
    {
        // record.current_tick.eye_lby_delta

        player->GetEyeAnglesXY()->y = lby + (-record.current_tick.eye_lby_delta);
        Globals::rmode[player->EntIndex()] = 5;
    }

    else if (record.current_tick.jitter_desync && record.current_tick.high_delta)
    {
        player->GetEyeAnglesXY()->y = record.current_tick.last_lby;
        Globals::rmode[player->EntIndex()] = 6;
    }

    else if (record.current_tick.low_delta && record.current_tick.jitter_desync)
    {
        player->GetEyeAnglesXY()->y = lby - record.current_tick.lby_delta;
        Globals::rmode[player->EntIndex()] = 7;
    }

    else
    {
        if (delta < 35.f && delta > -35) {
            if (player->GetVelocity().Length2D() > 0.1f)
            {
                player->GetEyeAnglesXY()->y = player->GetLowerBodyYaw();
                Globals::rmode[player->EntIndex()] = 1;
            }
        }
        else if (delta > 35.f) {
            Globals::rmode[player->EntIndex()] = 2;
            if (player->GetEyeAnglesXY()->y < 0.f && player->GetEyeAnglesXY()->y > -180.f)
                player->GetEyeAnglesXY()->y = g_Math.NormalizeYaw(player->GetEyeAnglesXY()->y + delta);
            else if (player->GetEyeAnglesXY()->y > 0.f && player->GetEyeAnglesXY()->y < 180.f)
                player->GetEyeAnglesXY()->y = g_Math.NormalizeYaw(player->GetEyeAnglesXY()->y - delta);
        }
        else if (delta < -35.f) {
            Globals::rmode[player->EntIndex()] = 3;
            if (player->GetEyeAnglesXY()->y < 0.f && player->GetEyeAnglesXY()->y > -180.f)
                player->GetEyeAnglesXY()->y = g_Math.NormalizeYaw(player->GetEyeAnglesXY()->y - delta);
            else if (player->GetEyeAnglesXY()->y > 0.f && player->GetEyeAnglesXY()->y < 180.f)
                player->GetEyeAnglesXY()->y = g_Math.NormalizeYaw(player->GetEyeAnglesXY()->y + delta);
        }
        else
        {
            Globals::rmode[player->EntIndex()] = 9;
            auto player_animation_state = player->AnimState();
            float m_flLastClientSideAnimationUpdateTimeDelta = fabs(player_animation_state->m_iLastClientSideAnimationUpdateFramecount - player_animation_state->m_flLastClientSideAnimationUpdateTime);

            auto FeetSpeed = 0.f;

            if (player_animation_state->m_flFeetSpeedForwardsOrSideWays >= 0.0f)
            {
                FeetSpeed = fminf(player_animation_state->m_flFeetSpeedForwardsOrSideWays, 1.0f);
            }
            else
            {
                FeetSpeed = 0.0f;
            }

            float Fraction = ((player_animation_state->m_flStopToFullRunningFraction * -0.30000001) - 0.19999999) * FeetSpeed;

            float YawMod = Fraction + 1.0;

            if (player_animation_state->m_fDuckAmount > 0.0) // duck checks
            {
                float curfeet = 0.0f;

                if (player_animation_state->m_flFeetSpeedUnknownForwardOrSideways >= 0.0)
                {
                    curfeet = fminf(player_animation_state->m_flFeetSpeedUnknownForwardOrSideways, 1.0);
                }
                else
                {
                    curfeet = 0.0f;
                }
            }

            float flMaxYawModifier = player_animation_state->pad10[516] * YawMod;
            float flMinYawModifier = player_animation_state->pad10[512] * YawMod;

            float newFeetYaw = 0.f;

            auto eyeYaw = player_animation_state->m_flEyeYaw;

            auto lbyYaw = player_animation_state->m_flGoalFeetYaw;

            float eye_feet_delta = fabs(eyeYaw - lbyYaw);

            if (eye_feet_delta <= flMaxYawModifier) // SetupVelocity in help
            {
                if (flMinYawModifier > eye_feet_delta)
                {
                    newFeetYaw = fabs(flMinYawModifier) + eyeYaw;
                }
            }
            else
            {
                newFeetYaw = eyeYaw - fabs(flMaxYawModifier);
            }

            float EndYaw = fmod(newFeetYaw, 360.0);

            if (EndYaw > 180.0)
            {
                EndYaw = EndYaw - 360.0;
            }

            if (EndYaw < 180.0)
            {
                EndYaw = EndYaw + 360.0;
            }

            player_animation_state->m_flGoalFeetYaw = EndYaw;

        }
    }
}

void Resolver::resolve(C_BaseEntity* player)
{
    auto local_player = Globals::LocalPlayer;

    if (!local_player)
        return;
    if (!c_config::get().resolve_new)
        return;



    if (!player)
        return;


    bool is_local_player = player == local_player;
    bool is_teammate = local_player->GetTeam() == player->GetTeam() && !is_local_player;

    if (is_local_player)
        return;

    if (is_teammate)
        return;

    if (player->GetHealth() <= 0)
        return;


    if (local_player->GetHealth() <= 0)
        return;

    auto idx = player->EntIndex();
    auto state = player->GetBasePlayerAnimState();
    auto lby = player->GetLowerBodyYaw();
    static float oldSimtimeShot[65];
    static float storedSimtimeShot[65];
    static float ShotTime[65];
    bool shot = false;
    Globals::enemyshot[idx] = false;


    if (storedSimtimeShot[idx] != player->GetSimulationTime())
    {
        if (player->GetActiveWeapon() && !player->IsKnifeorNade())
        {
            if (ShotTime[idx] != player->GetActiveWeapon()->GetLastShotTime())
            {
                shot = true;
                Globals::enemyshot[idx] = true;
                ShotTime[idx] = player->GetActiveWeapon()->GetLastShotTime();
            }
            else
            {
                shot = false;
                Globals::enemyshot[idx] = false;
            }
        }
        else
        {
            Globals::enemyshot[idx] = false;
            shot = false;
            ShotTime[idx] = 0.f;
        }

        oldSimtimeShot[idx] = storedSimtimeShot[idx];

        storedSimtimeShot[idx] = player->GetSimulationTime();
    }




    auto& record = _player[idx];

    if (state)
    {
        state->m_flEyeYaw = player->GetEyeAnglesXY()->y;
        state->m_flEyePitch = player->GetEyeAnglesXY()->x;
        player->setAnimationState(state);
    }

    if (state && state->speed_2d > 0.1f || fabs(state->flUpVelocity) > 100.0f)
    {
        state->m_flGoalFeetYaw = approach_angle(state->m_flEyeYaw, state->m_flGoalFeetYaw,
            ((state->m_flUnknownFraction * 20.0f) + 30.0f) * state->m_flLastClientSideAnimationUpdateTime);

        player->setAnimationState(state);
    }
    else
    {
        if (state)
        {
            state->m_flGoalFeetYaw = approach_angle(lby, state->m_flGoalFeetYaw,
                state->m_flLastClientSideAnimationUpdateTime * 100.0f);

            player->setAnimationState(state);
        }
    }

    record.current_tick.eyes = player->GetEyeAnglesXY()->y;

    if (record.current_tick.last_lby == FLT_MAX)
    {
        record.current_tick.last_lby = lby;
    }

    bool one = false;
    bool two = false;

    record.current_tick.lby_delta = record.current_tick.last_lby - lby;
    record.current_tick.eye_lby_delta = lby - record.current_tick.eyes;
    if (record.current_tick.last_lby != FLT_MAX)
    {
        if (player->GetVelocity().Length2D() > 0.1f)
        {
            if (record.current_tick.last_lby != lby)
                record.current_tick.last_lby = lby;

            one = false, two = false;
        }

        else
        {
            record.current_tick.lby_delta = record.current_tick.last_lby - lby;

            if (record.current_tick.last_lby != lby)
            {
                if (solve_desync_simple(player))
                {
                    if (delta_58(record.current_tick.last_lby, lby))
                    {
                        record.current_tick.low_delta = true;
                        record.current_tick.high_delta = false;
                    }
                    else
                    {
                        record.current_tick.low_delta = false;
                        record.current_tick.high_delta = true;
                    }

                    if (delta_58(lby, record.current_tick.eyes) && delta_58(record.current_tick.last_lby, record.current_tick.eyes))
                    {
                        if (!one || !two)
                            record.current_tick.jitter_desync = false;

                        if (one && two)
                            record.current_tick.jitter_desync = true;
                    }

                    if (record.current_tick.low_delta && !delta_58(record.current_tick.last_lby, record.current_tick.eyes))
                    {
                        if (!one)
                            one = true;

                        if (!two && one)
                            two = true;

                        if (one && two)
                            record.current_tick.jitter_desync = true;
                    }

                    //        else
                    //            record.current_tick.low_delta = true;
                }
                else
                    record.current_tick.static_desync = true;
            }
            else
            {
                if (!solve_desync_simple(player))
                {
                    one = false, two = false;

                    record.current_tick.static_desync = true;
                    record.current_tick.jitter_desync = false;

                }
                else
                {
                    if (!delta_58(record.current_tick.last_lby, record.current_tick.eyes))
                    {
                        record.current_tick.low_delta = false;
                        record.current_tick.high_delta = true;
                        record.current_tick.jitter_desync = true;
                    }
                    else
                    {
                        record.current_tick.low_delta = true;
                        record.current_tick.high_delta = false;
                        record.current_tick.jitter_desync = true;
                    }
                }
            }

        }
    }
    auto slow_walking = [&player]() -> bool
    {
        bool s = g_Resolver.enemy_is_slow_walking(player);

        if (s)
        {
            if (!(player->GetFlags() & FL_DUCKING))
            {
                g_Resolver.enemy_slowwalk = true;
                return true;
            }
            else
            {
                g_Resolver.enemy_slowwalk = false;
                return false;
            }
        }
        else
            return false;
    };
    if (slow_walking() && Globals::MissedShots[player->EntIndex()] >= 1)
    {
        Globals::enemyslow[player->EntIndex()] = true;
    }
    auto max_rotate = max_desync_angle(player);
    auto delta = angle_difference(player->GetEyeAnglesXY()->y, player->AnimState()->m_flCurrentFeetYaw);


    if (record.current_tick.low_delta && !record.current_tick.jitter_desync && record.current_tick.lby_delta < 58.f)
    {
        player->GetEyeAnglesXY()->y = record.current_tick.last_lby;
        Globals::rmode[player->EntIndex()] = 4;
    }

    else if (record.current_tick.jitter_desync && (!record.current_tick.high_delta || record.current_tick.low_delta))
    {
        // record.current_tick.eye_lby_delta

        player->GetEyeAnglesXY()->y = lby + (-record.current_tick.eye_lby_delta);
        Globals::rmode[player->EntIndex()] = 5;
    }

    else if (record.current_tick.jitter_desync && record.current_tick.high_delta)
    {
        player->GetEyeAnglesXY()->y = record.current_tick.last_lby;
        Globals::rmode[player->EntIndex()] = 6;
    }

    else if (record.current_tick.low_delta && record.current_tick.jitter_desync)
    {
        player->GetEyeAnglesXY()->y = lby - record.current_tick.lby_delta;
        Globals::rmode[player->EntIndex()] = 7;
    }

    else
    {

        Globals::rmode[player->EntIndex()] = 9;
        auto player_animation_state = player->AnimState();
        float m_flLastClientSideAnimationUpdateTimeDelta = fabs(player_animation_state->m_iLastClientSideAnimationUpdateFramecount - player_animation_state->m_flLastClientSideAnimationUpdateTime);

        auto v48 = 0.f;

        if (player_animation_state->m_flFeetSpeedForwardsOrSideWays >= 0.0f)
        {
            v48 = fminf(player_animation_state->m_flFeetSpeedForwardsOrSideWays, 1.0f);
        }
        else
        {
            v48 = 0.0f;
        }

        float v49 = ((player_animation_state->m_flStopToFullRunningFraction * -0.30000001) - 0.19999999) * v48;

        float flYawModifier = v49 + 1.0;

        if (player_animation_state->m_fDuckAmount > 0.0)
        {
            float v53 = 0.0f;

            if (player_animation_state->m_flFeetSpeedUnknownForwardOrSideways >= 0.0)
            {
                v53 = fminf(player_animation_state->m_flFeetSpeedUnknownForwardOrSideways, 1.0);
            }
            else
            {
                v53 = 0.0f;
            }
        }

        float flMaxYawModifier = player_animation_state->pad10[516] * flYawModifier;
        float flMinYawModifier = player_animation_state->pad10[512] * flYawModifier;

        float newFeetYaw = 0.f;

        auto eyeYaw = player_animation_state->m_flEyeYaw;

        auto lbyYaw = player_animation_state->m_flGoalFeetYaw;

        float eye_feet_delta = fabs(eyeYaw - lbyYaw);

        if (eye_feet_delta <= flMaxYawModifier)
        {
            if (flMinYawModifier > eye_feet_delta)
            {
                newFeetYaw = fabs(flMinYawModifier) + eyeYaw;
            }
        }
        else
        {
            newFeetYaw = eyeYaw - fabs(flMaxYawModifier);
        }

        float v136 = fmod(newFeetYaw, 360.0);

        if (v136 > 180.0)
        {
            v136 = v136 - 360.0;
        }

        if (v136 < 180.0)
        {
            v136 = v136 + 360.0;
        }

        player_animation_state->m_flGoalFeetYaw = v136;


    }



}

void bruhResolver(C_BaseEntity* ent)
{
    if (!c_config::get().resolver_fix)
        return;

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

    auto animstate = ent->AnimState();
    auto v9 = (animstate->m_iLastClientSideAnimationUpdateFramecount - animstate->m_flLastClientSideAnimationUpdateTime);
    auto speedfraction = 0.0f;
    if (animstate->m_flFeetSpeedForwardsOrSideWays < 0.0f)
        speedfraction = 0.0f;
    else
        speedfraction = fminf(animstate->m_flFeetSpeedForwardsOrSideWays, 0x3F800000);
    auto v2 = (animstate->pad_0x0120() * -0.30000001 - 0.19999999) * speedfraction;
    auto v18 = v2;
    auto v3 = v2 + 1.0;
    auto v23 = v3;
    if (animstate->m_fDuckAmount > 0.0)
    {
        auto v29 = 0.0;
        if (animstate->m_flFeetSpeedUnknownForwardOrSideways < 0.0)
            v29 = 0.0;
        else
            v29 = fminf(animstate->m_flFeetSpeedUnknownForwardOrSideways, 0x3F800000);
    }
    auto localplayer_index = Globals::LocalPlayer->EntIndex();
    auto localplayer = Globals::LocalPlayer;
    if (localplayer)
    {
        auto fix_goal_feet_yaw = [](float rotation, float invertedrotation, float yawfeetdelta, float yaw, C_AnimState* state) // some shit i found on pastebin lol
        {
            if (yawfeetdelta < rotation)
            {
                if (invertedrotation > yawfeetdelta)
                    *(float*)(uintptr_t(state) + 0x80) = invertedrotation + yaw;
            }
            else
                *(float*)(uintptr_t(state) + 0x80) = yaw - rotation;
        };

        auto get_rotation = [&](int rotation_type, C_AnimState* state) {
            float v43 = *(float*)((uintptr_t)state + 0xA4);
            float v54 = max(0, min(*reinterpret_cast<float*>((uintptr_t)state + 0xF8), 1));
            float v55 = max(0, min(1, *reinterpret_cast<float*>((uintptr_t)state + 0xFC)));

            float v56;
            v56 = ((*reinterpret_cast<float*>((uintptr_t)state + 0x11C) * -0.30000001) - 0.19999999) * v54;
            if (v43 > 0)
                v56 += ((v43 * v55) * (0.5 - v56));

            v56 = *(float*)((uintptr_t)state + rotation_type) * v56;
            return v56;
        };
        float inverted = get_rotation(0x2B4, ent->AnimState());
        float max = get_rotation(0x2B0, ent->AnimState());
        float yawfeetdelta = ent->AnimState()->m_flEyeYaw - ent->AnimState()->m_flGoalFeetYaw;
        float yaw = ent->GetEyeAngles().y;
        //if (c_config::get().fixfeet)
            //fix_goal_feet_yaw(max, inverted, yawfeetdelta, yaw, ent->AnimState());
        float speed;
        if (*(float*)(animstate + 0xF8) < 0.f)
        {
            speed = 0.0;
        }
        else
        {
            speed = fminf(*(DWORD*)(animstate + 0xF8), 1.0f);
        }

        float flYawModifier = (*(float*)(animstate + 0x11C) * -0.30000001 - 0.19999999) * speed;
        flYawModifier += 1.0f;

        if (*(float*)(animstate + 0xA4) > 0.0 && *(float*)(animstate + 0xFC) >= 0.0)
            flYawModifier = fminf(*(float*)(uintptr_t(animstate) + 0xFC), 1.0f);

        float m_flMaxBodyYaw = *(float*)(uintptr_t(animstate) + 0x334) * flYawModifier;
        float m_flMinBodyYaw = *(float*)(uintptr_t(animstate) + 0x330) * flYawModifier;

        float ResolvedYaw = animstate->m_flEyeYaw;
        float delta = std::abs(animstate->m_flEyeYaw - animstate->m_flGoalFeetYaw);
        if (m_flMaxBodyYaw < delta)
        {
            ResolvedYaw = animstate->m_flEyeYaw - std::abs(m_flMaxBodyYaw);
        }
        else if (m_flMinBodyYaw > delta)
        {
            ResolvedYaw = animstate->m_flEyeYaw + std::abs(m_flMinBodyYaw);
        }
        auto player = ent;
        auto v8 = 0;
        auto v7 = 0;
        for (int a2a = 0; a2a < Globals::LocalPlayer->GetNumAnimOverlays(); ++a2a)
        {
            auto v32 = Globals::LocalPlayer->GetAnimOverlay4(a2a);
            if (v32)
                auto v6 = Globals::LocalPlayer;
        }
        auto v20 = animstate->flUpVelocity * v23;
        auto a1 = animstate->m_vVelocityY * v23;
        auto v30 = 0.0;
        auto eye_angles_y = animstate->m_flEyeYaw;
        auto goal_feet_yaw = animstate->m_flGoalFeetYaw;
        auto v22 = (eye_angles_y - goal_feet_yaw);
        if (v20 < v22)
        {
            auto v11 = v20;
            auto v30 = eye_angles_y - v11;
        }
        else if (a1 > v22)
        {
            auto v12 = a1;
            auto v30 = v12 + eye_angles_y;
        }
        float v36 = std::fmodf(v30, 360.0f);
        if (v36 > 180.0f)
            v36 = v36 - 360.0f;
        if (v36 < 180.0f)
            v36 = v36 + 360.0f;
        float inverse = 0 - v36;
        switch (Globals::MissedShot % 4)
        {
        case 0:
            animstate->m_flGoalFeetYaw = animstate->m_flGoalFeetYaw + 45.0;
            break;
        case 1:
            animstate->m_flGoalFeetYaw = animstate->m_flGoalFeetYaw - 45.0;
            break;
        case 2:
            animstate->m_flGoalFeetYaw = animstate->m_flGoalFeetYaw - 30.0;
            break;
        case 3:
            animstate->m_flGoalFeetYaw = animstate->m_flGoalFeetYaw + 30.0;
            break;
        case 4:
            animstate->m_flGoalFeetYaw = animstate->m_flGoalFeetYaw - 89.0;
            break;
        case 5:
            animstate->m_flGoalFeetYaw = animstate->m_flGoalFeetYaw + 89.0;
            break;
        case 6:
            animstate->m_flGoalFeetYaw = animstate->m_flGoalFeetYaw - 116.0;
            break;
        case 7:
            animstate->m_flGoalFeetYaw = animstate->m_flGoalFeetYaw + 116.0;
            break;

        }
        switch (Globals::MissedShot % 3)
        {
        case 0:
            ent->SetAbsAngles(Vector(0, v36, 0));
            break;
        case 1:
            ent->SetAbsAngles(Vector(0, inverse, 0));
            break;
        case 2:
            ent->SetAbsAngles(Vector(0, AngleNormalize(ResolvedYaw), 0));
            break;
        }
    }
}

void FixPitch(C_BaseEntity* pEnt)
{
    float last_simtime[64] = { 0.f };
    float stored_pitch_1[64] = { 0.f };
    float fixed_pitch[64] = { 0.f };
    int to_spread_in_resolver[64];

    bool has_been_set[64] = { false };

    const auto local = Globals::LocalPlayer;
    if (!local)
        return;
    if (!c_config::get().pitch_resolver)
        return;
    for (auto i = 0; i < g_pEngine->GetMaxClients(); ++i)
    {

        const auto eye = pEnt->GetEyeAnglesXY();

        auto pitch = 0.f;

        if (stored_pitch_1[i] == FLT_MAX || !has_been_set[i])
        {
            stored_pitch_1[i] = eye->x;
            has_been_set[i] = true;
        }

        if (stored_pitch_1[i] - eye->x < 30 && stored_pitch_1[i] - eye->x > -30)
        {
            pitch = eye->x;
        }
        else
        {
            pitch = stored_pitch_1[i];
        }

        pEnt->GetEyeAnglesXY()->x = pitch;
    }
}

Vector GetSmoothedVelocity1(float min_delta, Vector a, Vector b) {
    Vector delta = a - b;
    float delta_length = delta.Length();

    if (delta_length <= min_delta) {
        Vector result;
        if (-min_delta <= delta_length) {
            return a;
        }
        else {
            float iradius = 1.0f / (delta_length + FLT_EPSILON);
            return b - ((delta * iradius) * min_delta);
        }
    }
    else {
        float iradius = 1.0f / (delta_length + FLT_EPSILON);
        return b + ((delta * iradius) * min_delta);
    }
}

float Resolver::approach(float cur, float target, float inc) {
    inc = abs(inc);

    if (cur < target)
        return min(cur + inc, target);
    if (cur > target)
        return max(cur - inc, target);

    return target;
}

float Resolver::approach_angle(float cur, float target, float inc) {
    auto diff = angle_difference(target, cur);
    return approach(cur, cur + diff, inc);
}

Vector GetSmoothedVelocity(float min_delta, Vector a, Vector b) {
    Vector delta = a - b;
    float delta_length = delta.Length();

    if (delta_length <= min_delta) {
        Vector result;
        if (-min_delta <= delta_length) {
            return a;
        }
        else {
            float iradius = 1.0f / (delta_length + FLT_EPSILON);
            return b - ((delta * iradius) * min_delta);
        }
    }
    else {
        float iradius = 1.0f / (delta_length + FLT_EPSILON);
        return b + ((delta * iradius) * min_delta);
    }
}

void resolve1(C_BaseEntity* ent)
{
    if (!c_config::get().aimbot_resolver)
        return;

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

    if (ent != Globals::LocalPlayer)
        enemy_anim_fix(ent);

    auto animState = ent->AnimState();

    static auto GetSmoothedVelocity = [](float min_delta, Vector a, Vector b) {
        Vector delta = a - b;
        float delta_length = delta.Length();

        if (delta_length <= min_delta) {
            Vector result;
            if (-min_delta <= delta_length) {
                return a;
            }
            else {
                float iradius = 1.0f / (delta_length + FLT_EPSILON);
                return b - ((delta * iradius) * min_delta);
            }
        }
        else {
            float iradius = 1.0f / (delta_length + FLT_EPSILON);
            return b + ((delta * iradius) * min_delta);
        }
    };
    float v25;
    v25 = std::clamp(animState->m_fLandingDuckAdditiveSomething + ent->m_flDuckAmount(), 1.0f, 0.0f);
    float v32;
    v32 = ent->GetSimulationTime() - ent->GetOldSimulationTime();
    float v26 = animState->m_fDuckAmount;
    float v27 = v32 * 6.0f;
    float v28;

    // clamp
    if ((v25 - v26) <= v27) {
        if (-v27 <= (v25 - v26))
            v28 = v25;
        else
            v28 = v26 - v27;
    }
    else {
        v28 = v26 + v27;
    }

    Vector velocity = ent->GetVelocity();
    float flDuckAmount = std::clamp(v28, 1.0f, 0.0f);

    Vector animationVelocity = GetSmoothedVelocity1(v32 * 2000.0f, velocity, animState->m_flVelocity());
    float speed = std::fminf(animationVelocity.Length(), 260.0f);

    auto weapon = (WeaponInfo_t*)Globals::LocalPlayer->GetActiveWeapon();

    float flMaxMovementSpeed = 260.0f;
    if (weapon) {
        flMaxMovementSpeed = std::fmaxf(weapon->max_speed, 0.001f);
    }

    float flRunningSpeed = speed / (flMaxMovementSpeed * 0.520f);
    float flDuckingSpeed = speed / (flMaxMovementSpeed * 0.340f);

    flRunningSpeed = std::clamp(flRunningSpeed, 0.0f, 1.0f);

    float flYawModifier = (((*(float*)(uintptr_t(animState) + 0x11c) * -0.3f) - 0.2f) * flRunningSpeed) + 1.0f;
    if (flDuckAmount > 0.0f) {
        float flDuckingSpeed = std::clamp(flDuckingSpeed, 0.0f, 1.0f);
        flYawModifier += (flDuckAmount * flDuckingSpeed) * (0.5f - flYawModifier);
    }

    float m_flMaxBodyYaw = *(float*)(uintptr_t(animState) + 0x334) * flYawModifier;
    float m_flMinBodyYaw = *(float*)(uintptr_t(animState) + 0x330) * flYawModifier;

    float flEyeYaw = ent->GetEyeAngles().y;
    float flEyeDiff = std::remainderf(flEyeYaw - g_Resolver.resolverinfoo.fakegoalfeetyaw, 360.f);

    if (flEyeDiff <= m_flMaxBodyYaw) {
        if (m_flMinBodyYaw > flEyeDiff)
            g_Resolver.resolverinfoo.fakegoalfeetyaw = fabs(m_flMinBodyYaw) + flEyeYaw;
    }
    else {
        g_Resolver.resolverinfoo.fakegoalfeetyaw = flEyeYaw - fabs(m_flMaxBodyYaw);
    }

    g_Resolver.resolverinfoo.fakegoalfeetyaw = std::remainderf(g_Resolver.resolverinfoo.fakegoalfeetyaw, 360.f);

    if (speed > 0.1f || fabs(velocity.z) > 100.0f) {
        g_Resolver.resolverinfoo.fakegoalfeetyaw = g_Resolver.approach_angle(
            flEyeYaw,
            g_Resolver.resolverinfoo.fakegoalfeetyaw,
            ((*(float*)(uintptr_t(animState) + 0x11c) * 20.0f) + 30.0f)
            * v32);
    }
    else {
        g_Resolver.resolverinfoo.fakegoalfeetyaw = g_Resolver.approach_angle(
            ent->GetLowerBodyYaw(),
            g_Resolver.resolverinfoo.fakegoalfeetyaw,
            v32 * 100.0f);
    }

    float Left = flEyeYaw - m_flMinBodyYaw;
    float Right = flEyeYaw - m_flMaxBodyYaw;

    float resolveYaw;
    switch (Globals::MissedShots[ent->EntIndex()] % 2)
    {
    case 0:
        resolveYaw = Left;
        break;
    case 1:
        resolveYaw = Right;
        break;
    }
    animState->m_flGoalFeetYaw = resolveYaw;
}


void Resolver::FrameStage(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())
            continue;
        if (pPlayerEntity->IsDormant())
        {
            wasDormant[i] = true;
            continue;
        }

        if (stage == FRAME_RENDER_START)
        {
            HandleHits(pPlayerEntity);
            AnimationFix(pPlayerEntity);
            /*if (c_config::get().lby_fix && pPlayerEntity != Globals::LocalPlayer) {
                LBY_FIX(pPlayerEntity);
            }
            if (c_config::get().resolver_fix && pPlayerEntity != Globals::LocalPlayer) {
                bruhResolver(pPlayerEntity);
            }
            if (c_config::get().pitch_resolver && pPlayerEntity != Globals::LocalPlayer) {
                FixPitch(pPlayerEntity);
            }
            if (c_config::get().resolve_old && pPlayerEntity != Globals::LocalPlayer) {
                resolveOldMethod(pPlayerEntity);
            }
            if (c_config::get().resolve_new && pPlayerEntity != Globals::LocalPlayer) {
                resolve(pPlayerEntity);
            }*/
            if (c_config::get().aimbot_resolver1)
            {
                if (pPlayerEntity != Globals::LocalPlayer)
                    resolve1(pPlayerEntity);

                if (pPlayerEntity != Globals::LocalPlayer)
                    pPlayerEntity->UpdateClientAnimation();
            }
        }

        if (stage == FRAME_NET_UPDATE_END && pPlayerEntity != Globals::LocalPlayer)
        {
            auto VarMap = reinterpret_cast<uintptr_t>(pPlayerEntity) + 36;
            auto VarMapSize = *reinterpret_cast<int*>(VarMap + 20);

            for (auto index = 0; index < VarMapSize; index++)
                *reinterpret_cast<uintptr_t*>(*reinterpret_cast<uintptr_t*>(VarMap) + index * 12) = 0;
        }

        wasDormant[i] = false;
    }
}
что то да могет, сам играл
А можно файлами мне просто настраивать лень?!
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Назад
Сверху Снизу