C++ PhysicSimulate from ENRAGE to LW (Ready to paste)

t.me/maj0rblog
Дизайнер
Статус
Оффлайн
Регистрация
6 Окт 2018
Сообщения
975
Реакции[?]
619
Поинты[?]
12K
hooked_player.cpp
C++:
_declspec(noinline)void hooks::physicssimulate_detour(player_t* player)
{
    auto& m_nSimulationTick = *reinterpret_cast<int*>(uintptr_t(player) + 0x2AC);
    auto cctx = reinterpret_cast<C_CommandContext*>(uintptr_t(player) + 0x34FC);

    if (!player
        || player->IsDead()
        || m_globals()->m_tickcount == m_nSimulationTick
        || player != g_ctx.local()
        || !cctx->needsprocessing
        || m_engine()->IsPlayingDemo()
        || m_engine()->IsHLTV()
        || player->m_fFlags() & 0x40)
    {
        ((PhysicsSimulateFn)original_physicssimulate)(player);
        return;
    }

    player->m_vphysicsCollisionState() = 0;

    const bool bValid = (cctx->cmd.m_tickcount != 0x7FFFFFFF);

    if (!bValid)
    {
        auto ndata = &engineprediction::get().m_Data[cctx->cmd.m_command_number % 150];

        ndata->m_nTickBase = player->m_nTickBase();

        ndata->command_number = cctx->cmd.m_command_number;
        ndata->m_aimPunchAngle = player->m_aimPunchAngle();
        ndata->m_aimPunchAngleVel = player->m_aimPunchAngleVel();
        ndata->m_viewPunchAngle = player->m_viewPunchAngle();
        ndata->m_vecViewOffset = player->m_vecViewOffset();
        ndata->m_vecViewOffset.z = fminf(fmaxf(ndata->m_vecViewOffset.z, 46.0f), 64.0f);
        ndata->m_vecVelocity = player->m_vecVelocity();
        ndata->m_vecOrigin = player->m_vecOrigin();
        ndata->m_flFallVelocity = player->m_flFallVelocity();
        ndata->m_flDuckAmount = player->m_flDuckAmount();
        ndata->m_flVelocityModifier = player->m_flVelocityModifier();
        ndata->tick_count = cctx->cmd.m_tickcount;
        ndata->is_filled = true;

        m_nSimulationTick = m_globals()->m_tickcount;
        cctx->needsprocessing = false;

        return;
    }
    else
    {
        const auto data = &engineprediction::get().m_Data[cctx->cmd.m_command_number % 150];

        if (data
            && data->command_number == (cctx->cmd.m_command_number - 1)
            && abs(data->command_number - cctx->cmd.m_command_number) <= 150)
        {
            engineprediction::get().FixNetvarCompression(cctx->cmd.m_command_number - 1);
        }

        auto shift_data = &engineprediction::get().m_Data[cctx->cmd.m_command_number % 150];

        const auto pre_change = player->m_nTickBase();

        if (cctx->cmd.m_command_number == (m_clientstate()->iCommandAck + 1)
            && g_ctx.globals.last_velocity_modifier >= 0.0f)
            player->m_flVelocityModifier() = g_ctx.globals.last_velocity_modifier;

        ((PhysicsSimulateFn)original_physicssimulate)(player);

        auto ndata = &engineprediction::get().m_Data[cctx->cmd.m_command_number % 150];

        ndata->m_nTickBase = player->m_nTickBase();
        ndata->command_number = cctx->cmd.m_command_number;
        ndata->m_aimPunchAngle = player->m_aimPunchAngle();
        ndata->m_aimPunchAngleVel = player->m_aimPunchAngleVel();
        ndata->m_viewPunchAngle = player->m_viewPunchAngle();
        ndata->m_vecViewOffset = player->m_vecViewOffset();
        ndata->m_vecViewOffset.z = fminf(fmaxf(ndata->m_vecViewOffset.z, 46.0f), 64.0f);
        ndata->m_vecVelocity = player->m_vecVelocity();
        ndata->m_vecOrigin = player->m_vecOrigin();
        ndata->m_flFallVelocity = player->m_flFallVelocity();
        ndata->m_flDuckAmount = player->m_flDuckAmount();
        ndata->m_flVelocityModifier = player->m_flVelocityModifier();
        ndata->tick_count = m_globals()->m_tickcount;
        ndata->is_filled = true;
    }
}

void __fastcall hooks::hooked_physicssimulate(player_t* player)
{
    return physicssimulate_detour(player);
}
Как я слышал это паста с немезиса

Если будет не хватать определений отпишите в тему
 
Последнее редактирование:
Пользователь
Статус
Оффлайн
Регистрация
3 Июл 2019
Сообщения
137
Реакции[?]
77
Поинты[?]
2K
насколько я знаю, enrage physicssimulate ничего не сделал
Зачем? valve уже фиксирует подергивание при прыжке. поэтому установка m_vphysicsCollisionStatet на 0 бесполезна
 
Пользователь
Статус
Оффлайн
Регистрация
9 Мар 2021
Сообщения
272
Реакции[?]
42
Поинты[?]
2K
hooked_player.cpp
C++:
_declspec(noinline)void hooks::physicssimulate_detour(player_t* player)
{
    auto& m_nSimulationTick = *reinterpret_cast<int*>(uintptr_t(player) + 0x2AC);
    auto cctx = reinterpret_cast<C_CommandContext*>(uintptr_t(player) + 0x34FC);

    if (!player
        || player->IsDead()
        || m_globals()->m_tickcount == m_nSimulationTick
        || player != g_ctx.local()
        || !cctx->needsprocessing
        || m_engine()->IsPlayingDemo()
        || m_engine()->IsHLTV()
        || player->m_fFlags() & 0x40)
    {
        ((PhysicsSimulateFn)original_physicssimulate)(player);
        return;
    }

    player->m_vphysicsCollisionState() = 0;

    const bool bValid = (cctx->cmd.m_tickcount != 0x7FFFFFFF);

    if (!bValid)
    {
        auto ndata = &engineprediction::get().m_Data[cctx->cmd.m_command_number % 150];

        ndata->m_nTickBase = player->m_nTickBase();

        ndata->command_number = cctx->cmd.m_command_number;
        ndata->m_aimPunchAngle = player->m_aimPunchAngle();
        ndata->m_aimPunchAngleVel = player->m_aimPunchAngleVel();
        ndata->m_viewPunchAngle = player->m_viewPunchAngle();
        ndata->m_vecViewOffset = player->m_vecViewOffset();
        ndata->m_vecViewOffset.z = fminf(fmaxf(ndata->m_vecViewOffset.z, 46.0f), 64.0f);
        ndata->m_vecVelocity = player->m_vecVelocity();
        ndata->m_vecOrigin = player->m_vecOrigin();
        ndata->m_flFallVelocity = player->m_flFallVelocity();
        ndata->m_flDuckAmount = player->m_flDuckAmount();
        ndata->m_flVelocityModifier = player->m_flVelocityModifier();
        ndata->tick_count = cctx->cmd.m_tickcount;
        ndata->is_filled = true;

        m_nSimulationTick = m_globals()->m_tickcount;
        cctx->needsprocessing = false;

        return;
    }
    else
    {
        const auto data = &engineprediction::get().m_Data[cctx->cmd.m_command_number % 150];

        if (data
            && data->command_number == (cctx->cmd.m_command_number - 1)
            && abs(data->command_number - cctx->cmd.m_command_number) <= 150)
        {
            engineprediction::get().FixNetvarCompression(cctx->cmd.m_command_number - 1);
        }

        auto shift_data = &engineprediction::get().m_Data[cctx->cmd.m_command_number % 150];

        const auto pre_change = player->m_nTickBase();

        if (cctx->cmd.m_command_number == (m_clientstate()->iCommandAck + 1)
            && g_ctx.globals.last_velocity_modifier >= 0.0f)
            player->m_flVelocityModifier() = g_ctx.globals.last_velocity_modifier;

        ((PhysicsSimulateFn)original_physicssimulate)(player);

        auto ndata = &engineprediction::get().m_Data[cctx->cmd.m_command_number % 150];

        ndata->m_nTickBase = player->m_nTickBase();
        ndata->command_number = cctx->cmd.m_command_number;
        ndata->m_aimPunchAngle = player->m_aimPunchAngle();
        ndata->m_aimPunchAngleVel = player->m_aimPunchAngleVel();
        ndata->m_viewPunchAngle = player->m_viewPunchAngle();
        ndata->m_vecViewOffset = player->m_vecViewOffset();
        ndata->m_vecViewOffset.z = fminf(fmaxf(ndata->m_vecViewOffset.z, 46.0f), 64.0f);
        ndata->m_vecVelocity = player->m_vecVelocity();
        ndata->m_vecOrigin = player->m_vecOrigin();
        ndata->m_flFallVelocity = player->m_flFallVelocity();
        ndata->m_flDuckAmount = player->m_flDuckAmount();
        ndata->m_flVelocityModifier = player->m_flVelocityModifier();
        ndata->tick_count = m_globals()->m_tickcount;
        ndata->is_filled = true;
    }
}

void __fastcall hooks::hooked_physicssimulate(player_t* player)
{
    return physicssimulate_detour(player);
}
Как я слышал это паста с немезиса

Если будет не хватать определений отпишите в тему
типо
upd: блять, что с качеством
 

Вложения

Забаненный
Статус
Оффлайн
Регистрация
13 Июн 2021
Сообщения
3
Реакции[?]
0
Поинты[?]
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Сверху Снизу