Вопрос Half of the player fakelags the rest constantly animates

Начинающий
Статус
Оффлайн
Регистрация
22 Сен 2021
Сообщения
37
Реакции[?]
10
Поинты[?]
3K
it only happens when i update animations to sync my real angle but when i only update animations on sendpacket it fixes everything and storing poseparameters and goalfeetyaw on sendpacket is already in there

Код:
 void UpdateLocalAnimations(Vector angle) {
        autoe = g_LocalPlayer;
        if (!e || !e->IsAlive() || !Globals::m_Command)
            return;
        auto state = e->GetPlayerAnimState();

        if(! state)
            return;
        int i = e->EntIndex();

        state->m_iLastClientSideAnimationUpdateFramecount = g_GlobalVars->framecount - 1;

        e->UpdateClientSideAnimation();

        if (Globals::m_flLastAnimUpdate != Globals::m_flAnimUpdate) {
            local_anims.store_animations(state);
            Globals::m_flLastAnimUpdate = Globals::m_flAnimUpdate;
        }
    }
    void SetLocalAnimations() {
        autoe = g_LocalPlayer;

        if (!e || !e->IsAlive())
            return;
        auto state = e->GetPlayerAnimState();
        if(! state)
            return;
        local_anims.set_animations(state);
        e->m_BuildBones(e->m_CachedBoneData().Base(), BONE_USED_BY_ANYTHING, g_GlobalVars->curtime);
    }
Код:
class LocalAnimations {
public:
    float yaw;
    float positions[24];
    void store_animations(CCSGOPlayerAnimState* state) {
        state->pBaseEntity->GetPoseParameters(poses);
        yaw = state->m_flGoalFeetYaw;
    }
    void set_animations(CCSGOPlayerAnimState* state) {
        state->pBaseEntity->set_abs_angles(Vector(0, yaw, 0));
        state->pBaseEntity->SetPoseParameters(poses);
    }
};
here is a video of what happens
Пожалуйста, авторизуйтесь для просмотра ссылки.
 
Последнее редактирование:
Сверху Снизу