Need help with local animation fix

get good get desync.vip
Забаненный
Статус
Оффлайн
Регистрация
19 Мар 2017
Сообщения
785
Реакции[?]
150
Поинты[?]
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Код:
 void lagcompensation::animation_fix(player_t * e)
{
    auto local_player = static_cast<player_t*>(g_csgo.m_entitylist()->GetClientEntity(g_csgo.m_engine()->GetLocalPlayer()));

    if (!local_player)
        return;

    if (!local_player->is_alive_local())
        return;

    static float sim_time;
    if (sim_time != local_player->get_simulation_time())
    {
        auto state = local_player->get_animation_state();
        if (!state) return;

        const float curtime = g_csgo.m_globals()->m_curtime;
        const float frametime = g_csgo.m_globals()->m_frametime;
        const float realtime = g_csgo.m_globals()->m_realtime;
        const float absoluteframetime = g_csgo.m_globals()->m_absoluteframetime;
        const float absoluteframestarttimestddev = g_csgo.m_globals()->m_absoluteframestarttimestddev;
        const float interpolation_amount = g_csgo.m_globals()->m_interpolation_amount;
        const float framecount = g_csgo.m_globals()->m_framecount;
        const float tickcount = g_csgo.m_globals()->m_tickcount;

        static auto host_timescale = g_csgo.m_cvar()->FindVar("host_timescale");

        g_csgo.m_globals()->m_curtime = local_player->get_simulation_time();
        g_csgo.m_globals()->m_realtime = local_player->get_simulation_time();
        g_csgo.m_globals()->m_frametime = g_csgo.m_globals()->m_interval_per_tick * host_timescale->GetFloat();
        g_csgo.m_globals()->m_absoluteframetime = g_csgo.m_globals()->m_interval_per_tick * host_timescale->GetFloat();
        g_csgo.m_globals()->m_absoluteframestarttimestddev = local_player->get_simulation_time() - g_csgo.m_globals()->m_interval_per_tick * host_timescale->GetFloat();
        g_csgo.m_globals()->m_interpolation_amount = 0;
        g_csgo.m_globals()->m_framecount = TIME_TO_TICKS(local_player->get_simulation_time());
        g_csgo.m_globals()->m_tickcount = TIME_TO_TICKS(local_player->get_simulation_time());

        int backup_flags = local_player->m_fFlags();
        int backup_eflags = local_player->get_eflags();

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

        if (state->m_iLastClientSideAnimationUpdateFramecount == g_csgo.m_globals()->m_framecount)
            state->m_iLastClientSideAnimationUpdateFramecount = g_csgo.m_globals()->m_framecount - 1;

        local_player->m_bClientSideAnimation() = true;
        local_player->update_clientside_animation();
        local_player->m_bClientSideAnimation() = false;


        float lby_delta = local_player->m_flLowerBodyYawTarget() - g_ctx.m_globals.real_angles.y;
        lby_delta = std::remainderf(lby_delta, 360.f);
        lby_delta = clamp(lby_delta, -60.f, 60.f);

        float feet_yaw = std::remainderf(g_ctx.m_globals.real_angles.y + lby_delta, 360.f);

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


        std::memcpy(local_player->get_anim_overlays(), backup_layers, (sizeof(AnimationLayer) * 15));

        local_player->m_fFlags() = backup_flags;
        local_player->get_eflags() = backup_eflags;


        g_csgo.m_globals()->m_curtime = curtime;
        g_csgo.m_globals()->m_realtime = realtime;
        g_csgo.m_globals()->m_frametime = frametime;
        g_csgo.m_globals()->m_absoluteframetime = absoluteframetime;
        g_csgo.m_globals()->m_absoluteframestarttimestddev = absoluteframestarttimestddev;
        g_csgo.m_globals()->m_interpolation_amount = interpolation_amount;
        g_csgo.m_globals()->m_framecount = framecount;
        g_csgo.m_globals()->m_tickcount = tickcount;
        sim_time = local_player->get_simulation_time();
    }
    local_player->invalidate_bone_cache();
    local_player->SetupBones(nullptr, -1, 0x7FF00, g_csgo.m_globals()->m_curtime);
}
Когда я включаю thirdperson моя моделька ломается.
В чем проблем?
 
Последнее редактирование:
Сверху Снизу