Вопрос Decent legendware local animfix

Эксперт
Статус
Оффлайн
Регистрация
30 Дек 2019
Сообщения
1,967
Реакции[?]
958
Поинты[?]
19K
Эксперт
Статус
Оффлайн
Регистрация
30 Дек 2019
Сообщения
1,967
Реакции[?]
958
Поинты[?]
19K
эт спс а второе фото пж?
создай масив, для лееров массив класса анимлеера с размером == кол-во лееров, для поспараметров массив флоата с размером == кол-во поспараметров
 
Начинающий
Статус
Оффлайн
Регистрация
5 Сен 2021
Сообщения
76
Реакции[?]
5
Поинты[?]
1K
попытаюсь
спс огромное я исправил но осталось только m_real_angles что с ними?
 
Последнее редактирование:
kira yoshikage
Пользователь
Статус
Оффлайн
Регистрация
21 Янв 2020
Сообщения
885
Реакции[?]
115
Поинты[?]
3K
Эксперт
Статус
Оффлайн
Регистрация
30 Дек 2019
Сообщения
1,967
Реакции[?]
958
Поинты[?]
19K
Начинающий
Статус
Оффлайн
Регистрация
5 Сен 2021
Сообщения
76
Реакции[?]
5
Поинты[?]
1K
посоветуйте ресольвер пж для лв
и зачем там нужен real_angles нельзя ли просто m_real_angles = csgo.local()->get_animation_state()->m_flGoalFeetYaw; это заюзать и объявить переменную
 
Эксперт
Статус
Оффлайн
Регистрация
30 Дек 2019
Сообщения
1,967
Реакции[?]
958
Поинты[?]
19K
Начинающий
Статус
Оффлайн
Регистрация
5 Сен 2021
Сообщения
76
Реакции[?]
5
Поинты[?]
1K
я исправил но у меня что-то не так
это происходит когда я приседаю и + при беге анимация ног какая-то тупарная
и почему-то когда выбираю yaw то они не работают но зато когда включаю десинк и пробую yaw они работают
 

Вложения

Последнее редактирование:
Начинающий
Статус
Оффлайн
Регистрация
26 Сен 2022
Сообщения
66
Реакции[?]
9
Поинты[?]
0
I fixed but I have something wrong
it happens when I squat and + when running the animation of the legs is kind of blunt
If you comment out the strafe stuff and m_flAccelerationWeight it should be better but legs will still be janky
I mostly fixed it for my cheat but there is still lots of problems with it, especially the legs. when turning your player its super fucked also
 
Последнее редактирование:
retard
Пользователь
Статус
Оффлайн
Регистрация
13 Мар 2021
Сообщения
368
Реакции[?]
67
Поинты[?]
10K
local animations:
#include "local_animations.h"
#include "..\misc\misc.h"

void local_animations::store_cm_animation_data(CUserCmd* cmd)
{
    local_data.cm_stored_viewangles = cmd->m_viewangles;
    local_data.cm_stored_commandnumber = cmd->m_command_number;
}

void local_animations::update_fake_animations(CUserCmd* cmd, bool* send_packet)
{
// do these yourself I can't be bothered.
}

void local_animations::update_local_animations(CUserCmd* cmd, bool* send_packet)
{
    static bool lock_viewangles = false;
    static Vector target_angle = local_data.cm_stored_viewangles;
    static Vector non_shot_target_angle = local_data.cm_stored_viewangles;

    g_ctx.local()->get_animlayers()[3].m_flWeight = 0.0f;
    g_ctx.local()->get_animlayers()[3].m_flCycle = 0.0f;

    if (g_ctx.globals.m_ragebot_shot_nr == local_data.cm_stored_commandnumber)
    {
        lock_viewangles = true;
        target_angle = local_data.cm_stored_viewangles;
    }

    if (!lock_viewangles)
        target_angle = local_data.cm_stored_viewangles;

    auto animstate = g_ctx.local()->get_animation_state();

    if (!animstate || !g_ctx.local()->is_alive() || g_ctx.local()->IsDormant())
    {
        m_real_spawntime = 0;
        return;
    }

    g_ctx.local()->m_flThirdpersonRecoil() = g_ctx.local()->m_aimPunchAngleScaled().x;

    c_animation_layer old_anim_layers[13];
    std::memcpy(old_anim_layers, g_ctx.local()->get_animlayers(), g_ctx.local()->animlayer_count() * sizeof(c_animation_layer));

    if (g_ctx.local()->m_flSpawnTime() != m_real_spawntime || animstate->m_pBaseEntity != g_ctx.local())
    {
        g_ctx.globals.updating_animation = true;
        g_ctx.local()->update_clientside_animation();
        g_ctx.globals.updating_animation = false;

        std::memcpy(g_ctx.local()->get_animlayers(), old_anim_layers, g_ctx.local()->animlayer_count() * sizeof(c_animation_layer));
        m_real_spawntime = g_ctx.local()->m_flSpawnTime();
    }

    const auto old_render_angles = g_ctx.local()->get_render_angles();
    const auto old_pose_params = g_ctx.local()->m_flPoseParameter();

    animstate->m_flUpdateTimeDelta = fmaxf(m_globals()->m_curtime - animstate->m_flLastClientSideAnimationUpdateTime, 0.f);

    g_ctx.local()->get_render_angles() = ((misc::get().hide_shots_key) && !g_ctx.globals.fakeducking && lock_viewangles) ? non_shot_target_angle : target_angle;

    if (animstate->m_pActiveWeapon != animstate->m_pLastActiveWeapon)
    {
        for (int i = 0; i < 13; i++)
        {
            c_animation_layer pLayer = g_ctx.local()->get_animlayers()[i];

            pLayer.m_pStudioHdr = NULL;
            pLayer.m_nDispatchSequence = -1;
            pLayer.m_nDispatchSequence_2 = -1;
        }
    }

    float flNewDuckAmount;
    if (animstate)
    {
        flNewDuckAmount = math::clamp(g_ctx.local()->m_flDuckAmount() + animstate->m_fLandingDuckAdditiveSomething, 0.0f, 1.0f);
        flNewDuckAmount = math::approach(flNewDuckAmount, animstate->m_fDuckAmount, animstate->m_flUpdateTimeDelta * 6.0f);
        flNewDuckAmount = math::clamp(flNewDuckAmount, 0.0f, 1.0f);
    }
    animstate->m_fDuckAmount = flNewDuckAmount;

    g_ctx.local()->m_nSequence() = 0;
    g_ctx.local()->m_flPlaybackRate() = 0.0f;
    g_ctx.local()->m_flCycle() = 0.0f;

    if (g_ctx.local()->m_flCycle() != 0.0f)
    {
        g_ctx.local()->m_flCycle() = 0.0f;
        g_ctx.local()->invalidate_physics_recursive(ANIMATION_CHANGED);
    }

    animstate->m_flFeetYawRate = 0;

    g_ctx.globals.updating_animation = true;
    g_ctx.local()->update_clientside_animation();
    g_ctx.globals.updating_animation = false;

    g_ctx.local()->force_bone_rebuild();
    g_ctx.local()->setup_local_bones();

    g_ctx.local()->get_animation_state()->m_flFeetCycle = old_anim_layers[6].m_flCycle;
    g_ctx.local()->get_animation_state()->m_flFeetYawRate = old_anim_layers[6].m_flWeight;
    g_ctx.local()->get_animation_state()->m_flStrafeChangeCycle = old_anim_layers[7].m_flCycle;
    g_ctx.local()->get_animation_state()->m_iStrafeSequence = old_anim_layers[7].m_nSequence;
    g_ctx.local()->get_animation_state()->m_flStrafeChangeWeight = old_anim_layers[7].m_flWeight;
    g_ctx.local()->get_animation_state()->m_flAccelerationWeight = old_anim_layers[12].m_flWeight;

    for (int i = 0; i < 13; ++i)
    {
        c_animation_layer layer = g_ctx.local()->get_animlayers()[i];
        if (!layer.m_nSequence && layer.m_pOwner && layer.m_flWeight != 0.0f)
        {
            ((player_t*)layer.m_pOwner)->invalidate_physics_recursive(BOUNDS_CHANGED);
            layer.m_flWeight = 0.0f;
        }
    }

    if (*send_packet == false)
    {
        std::memcpy(g_ctx.local()->get_animlayers(), old_anim_layers, g_ctx.local()->animlayer_count() * sizeof(c_animation_layer));
        return;
    }

    if (!lock_viewangles)
        non_shot_target_angle = local_data.cm_stored_viewangles;

    memcpy(m_real_poses, g_ctx.local()->m_flPoseParameter().data(), 24 * sizeof(float));
    m_real_angles = g_ctx.local()->get_animation_state()->m_flGoalFeetYaw;
    memcpy(m_real_layers, g_ctx.local()->get_animlayers(), g_ctx.local()->animlayer_count() * sizeof(c_animation_layer));

    g_ctx.local()->m_flPoseParameter() = old_pose_params;
    memcpy(g_ctx.local()->get_animlayers(), old_anim_layers, g_ctx.local()->animlayer_count() * sizeof(c_animation_layer));
    g_ctx.local()->get_render_angles() = old_render_angles;

    lock_viewangles = false;
}

void local_animations::build_local_bones(player_t* local)
{
    float pose_parameter[24];
    std::memcpy(pose_parameter, g_ctx.local()->m_flPoseParameter().data(), 24 * sizeof(float));

    local->force_bone_rebuild();

    std::memcpy(g_ctx.local()->m_flPoseParameter().data(), m_real_poses, 24 * sizeof(float));
    local->set_abs_angles(Vector(0, m_real_angles, 0));
    std::memcpy(g_ctx.local()->get_animlayers(), m_real_layers, g_ctx.local()->animlayer_count() * sizeof(c_animation_layer));

    local->setup_local_bones();
    std::memcpy(g_ctx.local()->m_flPoseParameter().data(), pose_parameter, 24 * sizeof(float));
}
create move:
// line 80.
const auto bk = g_ctx.local()->m_flThirdpersonRecoil();

    const auto movestate = g_ctx.local()->m_iMoveState();
    const auto iswalking = g_ctx.local()->m_bIsWalking();

    g_ctx.local()->m_iMoveState() = 0;
    g_ctx.local()->m_bIsWalking() = false;

    auto m_forward = cmd->m_buttons & IN_FORWARD;
    auto m_back = cmd->m_buttons & IN_BACK;
    auto m_right = cmd->m_buttons & IN_MOVERIGHT;
    auto m_left = cmd->m_buttons & IN_MOVELEFT;
    auto m_walking = cmd->m_buttons & IN_SPEED;

    bool m_walk_state = m_walking ? true : false;

    if (cmd->m_buttons & IN_DUCK || g_ctx.local()->m_bDucking() || g_ctx.local()->m_fFlags() & FL_DUCKING)
        m_walk_state = false;
    else if (m_walking)
    {
        float m_max_speed = g_ctx.local()->m_flMaxSpeed() * 0.52f;

        if (m_max_speed + 25.f > g_ctx.local()->m_vecVelocity().Length())
            g_ctx.local()->m_bIsWalking() = true;
    }

    auto move_buttons_pressed = cmd->m_buttons & (IN_FORWARD | IN_BACK | IN_MOVELEFT | IN_MOVERIGHT | IN_RUN);

    bool holding_forward_and_back;
    bool holding_right_and_left;

    if (!m_forward)
        holding_forward_and_back = false;
    else
        holding_forward_and_back = m_back;

    if (!m_right)
        holding_right_and_left = false;
    else
        holding_right_and_left = m_left;

    if (move_buttons_pressed)
    {
        if (holding_forward_and_back)
        {
            if (holding_right_and_left)
                g_ctx.local()->m_iMoveState() = 0;
            else if (m_right || m_left)
                g_ctx.local()->m_iMoveState() = 2;
            else
                g_ctx.local()->m_iMoveState() = 0;
        }
        else
        {
            if (holding_forward_and_back)
                g_ctx.local()->m_iMoveState() = 0;
            else if (m_back || m_forward)
                g_ctx.local()->m_iMoveState() = 2;
            else
                g_ctx.local()->m_iMoveState() = 0;
        }
    }

    if (g_ctx.local()->m_iMoveState() == 2 && m_walk_state)
        g_ctx.local()->m_iMoveState() = 1;

    local_animations::get().update_local_animations(cmd, &g_ctx.send_packet);

    g_ctx.local()->m_iMoveState() = movestate;
    g_ctx.local()->m_bIsWalking() = iswalking;
    g_ctx.local()->m_flThirdpersonRecoil() = bk;

// line 520, right after buy-bot.
local_animations::get().store_cm_animation_data(cmd);

// underneath if (g_ctx.globals.should_choke_packet) in create move replace old with this
if (!g_ctx.globals.weapon->is_non_aim())
        {
            auto double_tap_aim_check = false;

            if (cmd->m_buttons & IN_ATTACK && g_ctx.globals.double_tap_aim_check)
            {
                double_tap_aim_check = true;
                g_ctx.globals.double_tap_aim_check = false;
            }

            auto revolver_shoot = g_ctx.globals.weapon->m_iItemDefinitionIndex() == WEAPON_REVOLVER && !g_ctx.globals.revolver_working && (cmd->m_buttons & IN_ATTACK || cmd->m_buttons & IN_ATTACK2);

            if (cmd->m_buttons & IN_ATTACK && g_ctx.globals.weapon->m_iItemDefinitionIndex() != WEAPON_REVOLVER || revolver_shoot)
            {
                static auto weapon_recoil_scale = m_cvar()->FindVar(crypt_str("weapon_recoil_scale"));

                if (g_cfg.ragebot.enable)
                    cmd->m_viewangles -= g_ctx.local()->m_aimPunchAngle() * weapon_recoil_scale->GetFloat();

                if (!g_ctx.globals.fakeducking)
                {
                    g_ctx.globals.force_send_packet = true;
                    g_ctx.globals.should_choke_packet = true;
                    g_ctx.send_packet = true;
                    fakelag::get().started_peeking = false;
                }

                aim::get().last_shoot_position = g_ctx.globals.eye_pos;
                g_ctx.globals.m_ragebot_shot_nr = cmd->m_command_number;

                if (!double_tap_aim_check)
                    g_ctx.globals.double_tap_aim = false;
            }
        }
        else if (g_ctx.globals.weapon->is_knife() && (cmd->m_buttons & IN_ATTACK || cmd->m_buttons & IN_ATTACK2))
        {
            if (!g_ctx.globals.fakeducking) {
                g_ctx.globals.force_send_packet = true;
                g_ctx.globals.should_choke_packet = true;
                g_ctx.send_packet = true;
                fakelag::get().started_peeking = false;
            }

            g_ctx.globals.m_ragebot_shot_nr = cmd->m_command_number;
        }
player hook:
_declspec(noinline)void hooks::updateclientsideanimation_detour(player_t* player)
{
    if (g_ctx.globals.updating_skins)
        return;

    if (player == g_ctx.local())
    {
        if (!player->is_alive())
            return ((UpdateClientSideAnimationFn)original_updateclientsideanimation)(player);
        else
        {
            if (!g_ctx.globals.updating_animation)
            {
                c_animation_layer backup_layers[13];
                memcpy(backup_layers, g_ctx.local()->get_animlayers(), g_ctx.local()->animlayer_count() * sizeof(c_animation_layer));
                local_animations::get().build_local_bones(g_ctx.local());
                memcpy(g_ctx.local()->get_animlayers(), backup_layers, g_ctx.local()->animlayer_count() * sizeof(c_animation_layer));
            }
            else
                return ((UpdateClientSideAnimationFn)original_updateclientsideanimation)(player);
        }
    }

    if (g_ctx.globals.updating_animation && player != g_ctx.local())
        return ((UpdateClientSideAnimationFn)original_updateclientsideanimation)(player);

    if (!g_cfg.ragebot.enable && !g_cfg.legitbot.enabled)
        return ((UpdateClientSideAnimationFn)original_updateclientsideanimation)(player);

    if (!player->valid(false, false))
        return ((UpdateClientSideAnimationFn)original_updateclientsideanimation)(player);
}
aim.cpp:
// end of void aim::fire(CUserCmd* cmd) underneath g_ctx.globals.revolver_working = false;
g_ctx.globals.last_aimbot_shot = m_globals()->m_tickcount;
sdk:
Vector& player_t::get_render_angles()
{
    if (!this)
        return ZERO;

    static auto deadflag = netvars::get().get_offset(crypt_str("CBasePlayer"), crypt_str("deadflag"));
    return *(Vector*)(uintptr_t(this) + (deadflag + 0x4));
}

Vector& player_t::get_abs_angles()
{
    return call_virtual<Vector& (__thiscall*)(void*)>(this, 11)(this);
}

Vector& player_t::get_abs_origin()
{
    if (!this) //-V704
        return ZERO;

    return call_virtual<Vector& (__thiscall*)(void*)>(this, 10)(this);
}

bool player_t::setup_local_bones(int matrix)
{
    if (!this)
        return false;

    if (IsDormant())
        return false;

    static auto r_jiggle_bones = m_cvar()->FindVar("r_jiggle_bones");

    const auto penis = r_jiggle_bones->GetInt();
    const auto old_origin = get_abs_origin();
    const auto clientsideanim = m_bClientSideAnimation();

    r_jiggle_bones->SetValue(0);

    float bk = FLT_MAX;

    auto previous_weapon = get_animation_state() ? get_animation_state()->m_pLastBoneSetupWeapon : nullptr;

    if (previous_weapon)
        get_animation_state()->m_pLastBoneSetupWeapon = get_animation_state()->m_pActiveWeapon;

    if (this != g_ctx.local()) {
        set_abs_origin(m_vecOrigin());
    }
    else
    {
        if (get_animation_state() != nullptr && get_animation_state()->m_velocity < 0.1f && get_animation_state()->m_bOnGround && sequence_activity(get_animlayers()[3].m_nSequence) == 979)
        {
            bk = get_animlayers()[3].m_flWeight;

            get_animlayers()[3].m_flWeight = 0.f;
        }
    }

    const auto v20 = *(int*)(uintptr_t(this) + 0xA28);
    const auto v19 = *(int*)(uintptr_t(this) + 0xA30);
    const auto v22 = *(uint8_t*)(uintptr_t(this) + 0x68);
    const auto v62 = *(uint8_t*)(uintptr_t(this) + 0x274);

    *(uint8_t*)(uintptr_t(this) + 0x274) = 0;

    const auto effects = m_fEffects();
    m_fEffects() |= 8;

    *(int*)(uintptr_t(this) + 0xA68) = 0;
    *(int*)(uintptr_t(this) + 0xA28) &= ~10u;
    *(int*)(uintptr_t(this) + 0xA30) = 0;

    *(unsigned short*)(uintptr_t(this) + 0x68) |= 2;

    auto realtime_backup = m_globals()->m_realtime;
    auto curtime = m_globals()->m_curtime;
    auto frametime = m_globals()->m_frametime;
    auto absoluteframetime = m_globals()->m_absoluteframetime;
    auto framecount = m_globals()->m_framecount;
    auto tickcount = m_globals()->m_tickcount;
    auto interpolation_amount = m_globals()->m_interpolation_amount;

    float time = (this != g_ctx.local() ? m_flSimulationTime() : TICKS_TO_TIME(m_clientstate()->m_iServerTick));
    int ticks = TIME_TO_TICKS(time);

    m_globals()->m_curtime = time;
    m_globals()->m_realtime = time;
    m_globals()->m_frametime = m_globals()->m_intervalpertick;
    m_globals()->m_absoluteframetime = m_globals()->m_intervalpertick;
    m_globals()->m_framecount = ticks;
    m_globals()->m_tickcount = ticks;
    m_globals()->m_interpolation_amount = 0.f;

    const float weight12 = animlayer_count() < 12 ? -999 : get_animlayers()[12].m_flWeight;
    if (g_ctx.local() != this)
        get_animlayers()[12].m_flWeight = 0.f;

    m_globals()->m_framecount = -999;

    const auto v26 = *(int*)(uintptr_t(this) + 0x2670);

    *(int*)(uintptr_t(this) + 0x2670) = 0;
    g_ctx.globals.setuping_bones = true;

    m_bClientSideAnimation() = false;
    const bool result = SetupBones(nullptr, -1, matrix, time);
    m_bClientSideAnimation() = clientsideanim;

    g_ctx.globals.setuping_bones = false;

    *(int*)(uintptr_t(this) + 0x2670) = v26;

    *(int*)(uintptr_t(this) + 0xA28) = v20;
    *(int*)(uintptr_t(this) + 0xA30) = v19;
    *(unsigned short*)(uintptr_t(this) + 0x68) = v22;

    m_fEffects() = effects;

    *(uint8_t*)(uintptr_t(this) + 0x274) = v62;

    r_jiggle_bones->SetValue(penis);

    if (weight12 > -1)
        get_animlayers()[12].m_flWeight = weight12;

    m_globals()->m_realtime = realtime_backup;
    m_globals()->m_curtime = curtime;
    m_globals()->m_frametime = frametime;
    m_globals()->m_absoluteframetime = absoluteframetime;
    m_globals()->m_framecount = framecount;
    m_globals()->m_tickcount = tickcount;
    m_globals()->m_interpolation_amount = interpolation_amount;

    if (this != g_ctx.local())
        set_abs_origin(old_origin);
    else
    {
        if (bk < FLT_MAX)
            get_animlayers()[3].m_flWeight = bk;
    }

    if (previous_weapon)
        get_animation_state()->m_pLastBoneSetupWeapon = previous_weapon;

    return result;
}

void player_t::force_bone_rebuild()
{
    m_BoneAccessor().m_WritableBones = m_BoneAccessor().m_ReadableBones = 0;

    *(int*)(uintptr_t(this) + 0x2924) = 0xFF7FFFFF;
    *(int*)(uintptr_t(this) + 0x2690) = 0;
}
Пожалуйста, авторизуйтесь для просмотра ссылки.
As you can see they are 10000% better than default legendware, the jitter issues are fixed and they update correctly and don't randomly freeze like legendwares.
If you want to fix the layer lean then just do g_ctx.local()->get_animlayers()[12].m_flWeight = 0.0f; however I personally like it not being done.
If I have missed something just write.
post the .h file
 
Сверху Снизу