C++ linear extrapolations

retard
Пользователь
Статус
Оффлайн
Регистрация
13 Мар 2021
Сообщения
366
Реакции[?]
67
Поинты[?]
10K
C++:
template<class T, class U>

T fine(T in, U low, U high)

{

    if (in <= low)

        return low;



    if (in >= high)

        return high;



    return in;

}

void LagCompensation::LinearExtrapolations()

{

    if (g_menu.main.aimbot.lagfix.get())

    {

        auto m_local = g_cl.m_local;

        if (m_local && m_local->alive()) {

            for (int i = 1; i < g_csgo.m_globals->m_max_clients; i++)

            {

                auto m_entity = g_csgo.m_entlist->GetClientEntity(i);

                if (m_entity && m_entity->is_valid(m_local)) {



                    float simtime_delta = m_entity->m_flSimulationTime() - m_entity->m_flOldSimulationTime();

                    int choked_ticks = fine(game::TIME_TO_TICKS(simtime_delta), 1, 15);

                    vec3_t lastOrig;



                    if (lastOrig.length() != m_entity->m_vecOrigin().length())

                        lastOrig = m_entity->m_vecOrigin();



                    float delta_distance = (m_entity->m_vecOrigin() - lastOrig).length_sqr();

                    if (delta_distance > 4096.f)

                    {

                        vec3_t velocity_per_tick = m_entity->m_vecVelocity() * g_csgo.m_globals->m_interval;

                        auto new_origin = m_entity->m_vecOrigin() + (velocity_per_tick * choked_ticks);

                        m_entity->SetAbsOrigin(new_origin);

                    }

                }



            }

        }

    }

}
 
              ru p2cs > all                      
Разработчик
Статус
Оффлайн
Регистрация
19 Авг 2016
Сообщения
1,578
Реакции[?]
1,961
Поинты[?]
131K
Твой (или просто параша которую ты выложил) код при движении к краю обрыва просто будет идти по воздуху.

как МИНИМУМ нужно вызывать код который будет двигать игрока в твою предиктнутую позицию. Даже самый базовый ребилд TryPlayerMove как в супримаси/aimware уже будет на голову лучше чем этот код.
 
Начинающий
Статус
Оффлайн
Регистрация
24 Окт 2017
Сообщения
11
Реакции[?]
6
Поинты[?]
0
Your (or just the bucket that you posted) the code will simply go through the air when moving to the edge of the cliff.

at the LEAST you need to call the code that will move the player to your predicted position. Even the most basic rebuild of TryPlayerMove as in supremacy/aimware will already be better than this code.
thank you ledasirt i will now paste this in my p2c and go tap all
 
ЧВК EB_LAN
Эксперт
Статус
Онлайн
Регистрация
26 Янв 2021
Сообщения
1,548
Реакции[?]
517
Поинты[?]
192K
C++:
bool lc::breaklc( Player* pEntity ) {
    const auto valid = lagcomp.GetValidRecords(pEntity);

    if (valid.size( ) < 2)
        return false;

    auto prev_org = valid.at(0)->m_vecOrigin;
    auto skip_first = true;

    for (auto& record : valid) {
        if (skip_first) {
            skip_first = false;
            continue;
        }

        auto delta = record->m_vecOrigin - prev_org;
        if (delta.length_2d_sqr() > 4096.f)
            return true;

        if (record->m_flSimulationTime <= pEntity->m_flSimulationTime())
            break;

        prev_org = record->m_vecOrigin;
    }

    return false;
}
 
Сверху Снизу