Исходник Proper animation update $$$

main public enemy
Эксперт
Статус
Оффлайн
Регистрация
30 Ноя 2019
Сообщения
1,531
Реакции[?]
647
Поинты[?]
0
$$ Moneytalk comunity $$$​
Тема была создана по фану т.к половина югейма не знает даже как анимки обновить и наконец-то завести все таки этот ваш ресольвер вантапа...
Для особо одаренных профорсить m_flGoalFeetYaw = Yaw + 60 вам не достаточно, необходимо обовлять каждый чокнутый тик....


C++:
void C_AnimSync::UpdatePlayerAnimations( C_BasePlayer* pPlayer, C_LagRecord m_LatestRecord, C_LagRecord m_PreviousRecord, int32_t iRotateSide, bool bRotatePlayer )
{
    float_t flCurTime = g_GlobalVars->m_flCurTime;
    float_t flRealTime = g_GlobalVars->m_flRealTime;
    int32_t iFrameCount = g_GlobalVars->m_iFrameCount;
    int32_t iTickCount = g_GlobalVars->m_iTickCount;
    float_t flFrameTime = g_GlobalVars->m_flFrameTime;
    float_t flAbsFrameTime = g_GlobalVars->m_flAbsFrameTime;
    float_t flInterpolation = g_GlobalVars->m_flInterpolationAmount;

    float_t flDuckAmount = pPlayer->m_flDuckAmount( );
    int32_t iEFlags = pPlayer->m_iEFlags( );
    QAngle angEyeAngles = pPlayer->GetCSPlayer( )->m_angEyeAngles( );
    float_t flLowerBodyYaw = pPlayer->GetCSPlayer( )->m_flLowerBodyYaw( );

    float_t flFeetCycle = pPlayer->GetAnimationState( )->m_flFeetCycle;
    float_t flFeetWeight = pPlayer->GetAnimationState( )->m_flFeetWeight;

    pPlayer->m_iEFlags( ) &= ~EFL_DIRTY_ABSVELOCITY;
    pPlayer->m_fFlags( ) = m_LatestRecord.m_Flags;
    pPlayer->m_vecVelocity( ) = m_LatestRecord.m_Velocity;
    pPlayer->m_vecAbsVelocity( ) = m_LatestRecord.m_Velocity;

    pPlayer->SetAbsOrigin( m_LatestRecord.m_Origin );
    if ( g_PlayerData[ pPlayer->EntIndex( ) ].m_bHasPreviousRecord )
    {
        pPlayer->GetAnimationState( )->m_iStrafeSequence = m_PreviousRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_STRAFECHANGE ).m_nSequence;
        pPlayer->GetAnimationState( )->m_flStrafeCycle = m_PreviousRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_STRAFECHANGE ).m_flCycle;
        pPlayer->GetAnimationState( )->m_flStrafeWeight = m_PreviousRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_STRAFECHANGE ).m_flWeight;
        pPlayer->GetAnimationState( )->m_flFeetCycle = m_PreviousRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_MOVE ).m_flCycle;
        pPlayer->GetAnimationState( )->m_flFeetWeight = m_PreviousRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_MOVE ).m_flWeight;
        pPlayer->GetAnimationState( )->m_flLeanYaw = m_PreviousRecord.m_AnimationLayers.at( ANIMATION_LAYER_LEAN ).m_flWeight;

        std::memcpy( pPlayer->GetAnimationLayers( ), m_PreviousRecord.m_AnimationLayers.data( ), sizeof( C_AnimationLayer ) * 13 );
    }
    else
    {
        pPlayer->GetAnimationState( )->m_iStrafeSequence = m_LatestRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_STRAFECHANGE ).m_nSequence;
        pPlayer->GetAnimationState( )->m_flStrafeCycle = m_LatestRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_STRAFECHANGE ).m_flCycle;
        pPlayer->GetAnimationState( )->m_flStrafeWeight = m_LatestRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_STRAFECHANGE ).m_flWeight;
        pPlayer->GetAnimationState( )->m_flFeetCycle = m_LatestRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_MOVE ).m_flCycle;
        pPlayer->GetAnimationState( )->m_flFeetWeight = m_LatestRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_MOVE ).m_flWeight;
        pPlayer->GetAnimationState( )->m_flLeanYaw = m_LatestRecord.m_AnimationLayers.at( ANIMATION_LAYER_LEAN ).m_flWeight;

        pPlayer->GetAnimationState( )->m_flLastClientSideAnimationUpdateTime = m_LatestRecord.m_SimulationTime - TICKS_TO_TIME( m_LatestRecord.m_ChokedTicks );
        if ( m_LatestRecord.m_Flags & FL_ONGROUND )
        {
            pPlayer->GetAnimationState( )->m_bOnGround = true;
            pPlayer->GetAnimationState( )->m_bInHitGroundAnimation = false;
        }

        pPlayer->GetAnimationState( )->m_flTotalTimeInAir = 0.0f;
    }

    if ( m_LatestRecord.m_ChokedTicks <= 1 )
    {
        g_GlobalVars->m_flCurTime = m_LatestRecord.m_SimulationTime;
        g_GlobalVars->m_flRealTime = m_LatestRecord.m_SimulationTime;
        g_GlobalVars->m_flFrameTime = g_GlobalVars->m_flIntervalPerTick;
        g_GlobalVars->m_flAbsFrameTime = g_GlobalVars->m_flIntervalPerTick;
        g_GlobalVars->m_iFrameCount = TIME_TO_TICKS( m_LatestRecord.m_SimulationTime );
        g_GlobalVars->m_iTickCount = TIME_TO_TICKS( m_LatestRecord.m_SimulationTime );
        g_GlobalVars->m_flInterpolationAmount = 0.0f;

        if ( pPlayer->GetAnimationState( )->m_iLastClientSideAnimationUpdateFramecount >= g_GlobalVars->m_iTickCount )
            pPlayer->GetAnimationState( )->m_iLastClientSideAnimationUpdateFramecount = g_GlobalVars->m_iFrameCount - 1;

        if ( bRotatePlayer )
        {
            float_t flEyeYaw = 0.0f;
            if ( iRotateSide < 0 )
                flEyeYaw = m_LatestRecord.m_EyeAngles.yaw - 60.0f;
            else if ( iRotateSide > 0 )
                flEyeYaw = m_LatestRecord.m_EyeAngles.yaw + 60.0f;
            else
                flEyeYaw = m_LatestRecord.m_EyeAngles.yaw;
    
            pPlayer->GetAnimationState( )->m_flGoalFeetYaw = Math::NormalizeAngle( flEyeYaw );
        }

        pPlayer->GetCSPlayer( )->m_angEyeAngles( ) = m_LatestRecord.m_EyeAngles;
        pPlayer->GetCSPlayer( )->m_flLowerBodyYaw( ) = m_LatestRecord.m_LowerBodyYaw;
        pPlayer->m_flDuckAmount( ) = m_LatestRecord.m_DuckAmount;

        for ( int i = 0; i < 13; i++ )
            pPlayer->GetAnimationLayers( )[ i ].m_pOwner = pPlayer;
    
        bool bClientSideAnimation = pPlayer->GetBaseAnimating( )->m_bClientSideAnimation( );
        g_Globals.m_AnimationData.m_bUpdateClientSideAnimation = pPlayer->GetBaseAnimating( )->m_bClientSideAnimation( ) = true;
        ( ( void( __thiscall* )( void* ) )( g_Globals.m_AddressList.UpdateClientSideAnimation ) )( pPlayer );
        g_Globals.m_AnimationData.m_bUpdateClientSideAnimation = false;
        pPlayer->GetBaseAnimating( )->m_bClientSideAnimation( ) = bClientSideAnimation;

        g_GlobalVars->m_flCurTime = flCurTime;
        g_GlobalVars->m_flRealTime = flRealTime;
        g_GlobalVars->m_flFrameTime = flFrameTime;
        g_GlobalVars->m_flAbsFrameTime = flAbsFrameTime;
        g_GlobalVars->m_iFrameCount = iFrameCount;
        g_GlobalVars->m_iTickCount = iTickCount;
        g_GlobalVars->m_flInterpolationAmount = flInterpolation;
    }
    else
    {
        int32_t iSimulationTick = 1;
        do
        {
            float_t flSimulationTime = pPlayer->m_flOldSimulationTime( ) + TICKS_TO_TIME( iSimulationTick );
            if ( g_PlayerData[ pPlayer->EntIndex( ) ].m_bHasPreviousRecord )
                flSimulationTime = g_PlayerData[ pPlayer->EntIndex( ) ].m_PreviousRecord.m_SimulationTime + TICKS_TO_TIME( iSimulationTick );

            g_GlobalVars->m_flCurTime = flSimulationTime;
            g_GlobalVars->m_flRealTime = flSimulationTime;
            g_GlobalVars->m_flFrameTime = g_GlobalVars->m_flIntervalPerTick;
            g_GlobalVars->m_flAbsFrameTime = g_GlobalVars->m_flIntervalPerTick;
            g_GlobalVars->m_iFrameCount = TIME_TO_TICKS( flSimulationTime );
            g_GlobalVars->m_iTickCount = TIME_TO_TICKS( flSimulationTime );
            g_GlobalVars->m_flInterpolationAmount = 0.0f;

            if ( pPlayer->GetAnimationState( )->m_iLastClientSideAnimationUpdateFramecount >= g_GlobalVars->m_iTickCount )
                pPlayer->GetAnimationState( )->m_iLastClientSideAnimationUpdateFramecount = g_GlobalVars->m_iFrameCount - 1;

            if ( bRotatePlayer )
            {
                float_t flEyeYaw = 0.0f;
                if ( iRotateSide < 0 )
                    flEyeYaw = m_LatestRecord.m_EyeAngles.yaw - 60.0f;
                else if ( iRotateSide > 0 )
                    flEyeYaw = m_LatestRecord.m_EyeAngles.yaw + 60.0f;
                else
                    flEyeYaw = m_LatestRecord.m_EyeAngles.yaw;
    
                pPlayer->GetAnimationState( )->m_flGoalFeetYaw = Math::NormalizeAngle( flEyeYaw );
            }

            if ( m_LatestRecord.m_DuckPerTick )
                pPlayer->m_flDuckAmount( ) += m_LatestRecord.m_DuckPerTick * iSimulationTick;
    
            for ( int i = 0; i < 13; i++ )
                pPlayer->GetAnimationLayers( )[ i ].m_pOwner = pPlayer;

            bool bClientSideAnimation = pPlayer->GetBaseAnimating( )->m_bClientSideAnimation( );
            g_Globals.m_AnimationData.m_bUpdateClientSideAnimation = pPlayer->GetBaseAnimating( )->m_bClientSideAnimation( ) = true;
            ( ( void( __thiscall* )( void* ) )( g_Globals.m_AddressList.UpdateClientSideAnimation ) )( pPlayer );
            g_Globals.m_AnimationData.m_bUpdateClientSideAnimation = false;
            pPlayer->GetBaseAnimating( )->m_bClientSideAnimation( ) = bClientSideAnimation;

            g_GlobalVars->m_flCurTime = flCurTime;
            g_GlobalVars->m_flRealTime = flRealTime;
            g_GlobalVars->m_flFrameTime = flFrameTime;
            g_GlobalVars->m_flAbsFrameTime = flAbsFrameTime;
            g_GlobalVars->m_iFrameCount = iFrameCount;
            g_GlobalVars->m_iTickCount = iTickCount;
            g_GlobalVars->m_flInterpolationAmount = flInterpolation;

            // increase simulation tick
            iSimulationTick++;
        }
        while ( iSimulationTick <= m_LatestRecord.m_ChokedTicks );
    }

    g_GlobalVars->m_flCurTime = flCurTime;
    g_GlobalVars->m_flRealTime = flRealTime;
    g_GlobalVars->m_flFrameTime = flFrameTime;
    g_GlobalVars->m_flAbsFrameTime = flAbsFrameTime;
    g_GlobalVars->m_iFrameCount = iFrameCount;
    g_GlobalVars->m_iTickCount = iTickCount;
    g_GlobalVars->m_flInterpolationAmount = flInterpolation;

    pPlayer->GetAnimationState( )->m_flFeetCycle = flFeetCycle;
    pPlayer->GetAnimationState( )->m_flFeetWeight = flFeetWeight;

    pPlayer->GetCSPlayer( )->m_angEyeAngles( ) = angEyeAngles;
    pPlayer->GetCSPlayer( )->m_flLowerBodyYaw( ) = flLowerBodyYaw;
    pPlayer->m_flDuckAmount( ) = flDuckAmount;
    pPlayer->m_iEFlags( ) = iEFlags;

    return pPlayer->InvalidatePhysicsRecursive( ANIMATION_CHANGED );
}


C-like:
UpdatePlayerAnimations( pRecord->m_pPlayer, pRecord, pPreviousRecord, 1, true);
// Ваше :
{
    std::memcpy( pRecord.ResolverLayers[1], pPlayer->GetAnimationLayers( ), sizeof( C_AnimationLayer ) * 13 );
}
INFO : Код порчеса внезапно отличается от кода актуального вантапа !!!!
Норм челики это заметили по одной вещи, а остальным соболезную
 
Последнее редактирование:
Забаненный
Статус
Оффлайн
Регистрация
29 Май 2021
Сообщения
117
Реакции[?]
18
Поинты[?]
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Уникальное звание
Пользователь
Статус
Оффлайн
Регистрация
8 Авг 2019
Сообщения
681
Реакции[?]
132
Поинты[?]
6K
это конечно супер круто, но теперь челы пойдут возьмут на серьезе пойдут пастить ресольвер в2, сделают премиум ресольвер в5, добавят 6 дельт, где 3 дельты это проверка на лбу, влепят антифристенд, добавят миллион проверок на автоволл чтобы чит хитал, спастят бектрек ресольвер и будет их чит хитать на все 100 :CoolCat: :CoolCat: :CoolCat: :CoolCat: :CoolCat: :CoolCat: :CoolCat: . но и тут их ждет кое-какая подстава с аним ресольвером)))))) ( не бейте это шутка, но это вам не поможет)
 
main public enemy
Эксперт
Статус
Оффлайн
Регистрация
30 Ноя 2019
Сообщения
1,531
Реакции[?]
647
Поинты[?]
0
это конечно супер круто, но теперь челы пойдут возьмут на серьезе пойдут пастить ресольвер в2, сделают премиум ресольвер в5, добавят 6 дельт, где 3 дельты это проверка на лбу, влепят антифристенд, добавят миллион проверок на автоволл чтобы чит хитал, спастят бектрек ресольвер и будет их чит хитать на все 100 :CoolCat: :CoolCat: :CoolCat: :CoolCat: :CoolCat: :CoolCat: :CoolCat: . но и тут их ждет кое-какая подстава с аним ресольвером)))))) ( не бейте это шутка, но это вам не поможет)
Что
 
Начинающий
Статус
Оффлайн
Регистрация
20 Апр 2021
Сообщения
263
Реакции[?]
19
Поинты[?]
4K
$$ Moneytalk comunity $$$​
Тема была создана по фану т.к половина югейма не знает даже как анимки обновить и наконец-то завести все таки этот ваш ресольвер вантапа...
Для особо одаренных профорсить m_flGoalFeetYaw = Yaw + 60 вам не достаточно, необходимо обовлять каждый чокнутый тик....


C++:
void C_AnimSync::UpdatePlayerAnimations( C_BasePlayer* pPlayer, C_LagRecord m_LatestRecord, C_LagRecord m_PreviousRecord, int32_t iRotateSide, bool bRotatePlayer )
{
    float_t flCurTime = g_GlobalVars->m_flCurTime;
    float_t flRealTime = g_GlobalVars->m_flRealTime;
    int32_t iFrameCount = g_GlobalVars->m_iFrameCount;
    int32_t iTickCount = g_GlobalVars->m_iTickCount;
    float_t flFrameTime = g_GlobalVars->m_flFrameTime;
    float_t flAbsFrameTime = g_GlobalVars->m_flAbsFrameTime;
    float_t flInterpolation = g_GlobalVars->m_flInterpolationAmount;

    float_t flDuckAmount = pPlayer->m_flDuckAmount( );
    int32_t iEFlags = pPlayer->m_iEFlags( );
    QAngle angEyeAngles = pPlayer->GetCSPlayer( )->m_angEyeAngles( );
    float_t flLowerBodyYaw = pPlayer->GetCSPlayer( )->m_flLowerBodyYaw( );

    float_t flFeetCycle = pPlayer->GetAnimationState( )->m_flFeetCycle;
    float_t flFeetWeight = pPlayer->GetAnimationState( )->m_flFeetWeight;

    pPlayer->m_iEFlags( ) &= ~EFL_DIRTY_ABSVELOCITY;
    pPlayer->m_fFlags( ) = m_LatestRecord.m_Flags;
    pPlayer->m_vecVelocity( ) = m_LatestRecord.m_Velocity;
    pPlayer->m_vecAbsVelocity( ) = m_LatestRecord.m_Velocity;

    pPlayer->SetAbsOrigin( m_LatestRecord.m_Origin );
    if ( g_PlayerData[ pPlayer->EntIndex( ) ].m_bHasPreviousRecord )
    {
        pPlayer->GetAnimationState( )->m_iStrafeSequence = m_PreviousRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_STRAFECHANGE ).m_nSequence;
        pPlayer->GetAnimationState( )->m_flStrafeCycle = m_PreviousRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_STRAFECHANGE ).m_flCycle;
        pPlayer->GetAnimationState( )->m_flStrafeWeight = m_PreviousRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_STRAFECHANGE ).m_flWeight;
        pPlayer->GetAnimationState( )->m_flFeetCycle = m_PreviousRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_MOVE ).m_flCycle;
        pPlayer->GetAnimationState( )->m_flFeetWeight = m_PreviousRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_MOVE ).m_flWeight;
        pPlayer->GetAnimationState( )->m_flLeanYaw = m_PreviousRecord.m_AnimationLayers.at( ANIMATION_LAYER_LEAN ).m_flWeight;

        std::memcpy( pPlayer->GetAnimationLayers( ), m_PreviousRecord.m_AnimationLayers.data( ), sizeof( C_AnimationLayer ) * 13 );
    }
    else
    {
        pPlayer->GetAnimationState( )->m_iStrafeSequence = m_LatestRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_STRAFECHANGE ).m_nSequence;
        pPlayer->GetAnimationState( )->m_flStrafeCycle = m_LatestRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_STRAFECHANGE ).m_flCycle;
        pPlayer->GetAnimationState( )->m_flStrafeWeight = m_LatestRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_STRAFECHANGE ).m_flWeight;
        pPlayer->GetAnimationState( )->m_flFeetCycle = m_LatestRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_MOVE ).m_flCycle;
        pPlayer->GetAnimationState( )->m_flFeetWeight = m_LatestRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_MOVE ).m_flWeight;
        pPlayer->GetAnimationState( )->m_flLeanYaw = m_LatestRecord.m_AnimationLayers.at( ANIMATION_LAYER_LEAN ).m_flWeight;

        pPlayer->GetAnimationState( )->m_flLastClientSideAnimationUpdateTime = m_LatestRecord.m_SimulationTime - TICKS_TO_TIME( m_LatestRecord.m_ChokedTicks );
        if ( m_LatestRecord.m_Flags & FL_ONGROUND )
        {
            pPlayer->GetAnimationState( )->m_bOnGround = true;
            pPlayer->GetAnimationState( )->m_bInHitGroundAnimation = false;
        }

        pPlayer->GetAnimationState( )->m_flTotalTimeInAir = 0.0f;
    }

    if ( m_LatestRecord.m_ChokedTicks <= 1 )
    {
        g_GlobalVars->m_flCurTime = m_LatestRecord.m_SimulationTime;
        g_GlobalVars->m_flRealTime = m_LatestRecord.m_SimulationTime;
        g_GlobalVars->m_flFrameTime = g_GlobalVars->m_flIntervalPerTick;
        g_GlobalVars->m_flAbsFrameTime = g_GlobalVars->m_flIntervalPerTick;
        g_GlobalVars->m_iFrameCount = TIME_TO_TICKS( m_LatestRecord.m_SimulationTime );
        g_GlobalVars->m_iTickCount = TIME_TO_TICKS( m_LatestRecord.m_SimulationTime );
        g_GlobalVars->m_flInterpolationAmount = 0.0f;

        if ( pPlayer->GetAnimationState( )->m_iLastClientSideAnimationUpdateFramecount >= g_GlobalVars->m_iTickCount )
            pPlayer->GetAnimationState( )->m_iLastClientSideAnimationUpdateFramecount = g_GlobalVars->m_iFrameCount - 1;

        if ( bRotatePlayer )
        {
            float_t flEyeYaw = 0.0f;
            if ( iRotateSide < 0 )
                flEyeYaw = m_LatestRecord.m_EyeAngles.yaw - 60.0f;
            else if ( iRotateSide > 0 )
                flEyeYaw = m_LatestRecord.m_EyeAngles.yaw + 60.0f;
            else
                flEyeYaw = m_LatestRecord.m_EyeAngles.yaw;
   
            pPlayer->GetAnimationState( )->m_flGoalFeetYaw = Math::NormalizeAngle( flEyeYaw );
        }

        pPlayer->GetCSPlayer( )->m_angEyeAngles( ) = m_LatestRecord.m_EyeAngles;
        pPlayer->GetCSPlayer( )->m_flLowerBodyYaw( ) = m_LatestRecord.m_LowerBodyYaw;
        pPlayer->m_flDuckAmount( ) = m_LatestRecord.m_DuckAmount;

        for ( int i = 0; i < 13; i++ )
            pPlayer->GetAnimationLayers( )[ i ].m_pOwner = pPlayer;
   
        bool bClientSideAnimation = pPlayer->GetBaseAnimating( )->m_bClientSideAnimation( );
        g_Globals.m_AnimationData.m_bUpdateClientSideAnimation = pPlayer->GetBaseAnimating( )->m_bClientSideAnimation( ) = true;
        ( ( void( __thiscall* )( void* ) )( g_Globals.m_AddressList.UpdateClientSideAnimation ) )( pPlayer );
        g_Globals.m_AnimationData.m_bUpdateClientSideAnimation = false;
        pPlayer->GetBaseAnimating( )->m_bClientSideAnimation( ) = bClientSideAnimation;

        g_GlobalVars->m_flCurTime = flCurTime;
        g_GlobalVars->m_flRealTime = flRealTime;
        g_GlobalVars->m_flFrameTime = flFrameTime;
        g_GlobalVars->m_flAbsFrameTime = flAbsFrameTime;
        g_GlobalVars->m_iFrameCount = iFrameCount;
        g_GlobalVars->m_iTickCount = iTickCount;
        g_GlobalVars->m_flInterpolationAmount = flInterpolation;
    }
    else
    {
        int32_t iSimulationTick = 1;
        do
        {
            float_t flSimulationTime = pPlayer->m_flOldSimulationTime( ) + TICKS_TO_TIME( iSimulationTick );
            if ( g_PlayerData[ pPlayer->EntIndex( ) ].m_bHasPreviousRecord )
                flSimulationTime = g_PlayerData[ pPlayer->EntIndex( ) ].m_PreviousRecord.m_SimulationTime + TICKS_TO_TIME( iSimulationTick );

            g_GlobalVars->m_flCurTime = flSimulationTime;
            g_GlobalVars->m_flRealTime = flSimulationTime;
            g_GlobalVars->m_flFrameTime = g_GlobalVars->m_flIntervalPerTick;
            g_GlobalVars->m_flAbsFrameTime = g_GlobalVars->m_flIntervalPerTick;
            g_GlobalVars->m_iFrameCount = TIME_TO_TICKS( flSimulationTime );
            g_GlobalVars->m_iTickCount = TIME_TO_TICKS( flSimulationTime );
            g_GlobalVars->m_flInterpolationAmount = 0.0f;

            if ( pPlayer->GetAnimationState( )->m_iLastClientSideAnimationUpdateFramecount >= g_GlobalVars->m_iTickCount )
                pPlayer->GetAnimationState( )->m_iLastClientSideAnimationUpdateFramecount = g_GlobalVars->m_iFrameCount - 1;

            if ( bRotatePlayer )
            {
                float_t flEyeYaw = 0.0f;
                if ( iRotateSide < 0 )
                    flEyeYaw = m_LatestRecord.m_EyeAngles.yaw - 60.0f;
                else if ( iRotateSide > 0 )
                    flEyeYaw = m_LatestRecord.m_EyeAngles.yaw + 60.0f;
                else
                    flEyeYaw = m_LatestRecord.m_EyeAngles.yaw;
   
                pPlayer->GetAnimationState( )->m_flGoalFeetYaw = Math::NormalizeAngle( flEyeYaw );
            }

            if ( m_LatestRecord.m_DuckPerTick )
                pPlayer->m_flDuckAmount( ) += m_LatestRecord.m_DuckPerTick * iSimulationTick;
   
            for ( int i = 0; i < 13; i++ )
                pPlayer->GetAnimationLayers( )[ i ].m_pOwner = pPlayer;

            bool bClientSideAnimation = pPlayer->GetBaseAnimating( )->m_bClientSideAnimation( );
            g_Globals.m_AnimationData.m_bUpdateClientSideAnimation = pPlayer->GetBaseAnimating( )->m_bClientSideAnimation( ) = true;
            ( ( void( __thiscall* )( void* ) )( g_Globals.m_AddressList.UpdateClientSideAnimation ) )( pPlayer );
            g_Globals.m_AnimationData.m_bUpdateClientSideAnimation = false;
            pPlayer->GetBaseAnimating( )->m_bClientSideAnimation( ) = bClientSideAnimation;

            g_GlobalVars->m_flCurTime = flCurTime;
            g_GlobalVars->m_flRealTime = flRealTime;
            g_GlobalVars->m_flFrameTime = flFrameTime;
            g_GlobalVars->m_flAbsFrameTime = flAbsFrameTime;
            g_GlobalVars->m_iFrameCount = iFrameCount;
            g_GlobalVars->m_iTickCount = iTickCount;
            g_GlobalVars->m_flInterpolationAmount = flInterpolation;

            // increase simulation tick
            iSimulationTick++;
        }
        while ( iSimulationTick <= m_LatestRecord.m_ChokedTicks );
    }

    g_GlobalVars->m_flCurTime = flCurTime;
    g_GlobalVars->m_flRealTime = flRealTime;
    g_GlobalVars->m_flFrameTime = flFrameTime;
    g_GlobalVars->m_flAbsFrameTime = flAbsFrameTime;
    g_GlobalVars->m_iFrameCount = iFrameCount;
    g_GlobalVars->m_iTickCount = iTickCount;
    g_GlobalVars->m_flInterpolationAmount = flInterpolation;

    pPlayer->GetAnimationState( )->m_flFeetCycle = flFeetCycle;
    pPlayer->GetAnimationState( )->m_flFeetWeight = flFeetWeight;

    pPlayer->GetCSPlayer( )->m_angEyeAngles( ) = angEyeAngles;
    pPlayer->GetCSPlayer( )->m_flLowerBodyYaw( ) = flLowerBodyYaw;
    pPlayer->m_flDuckAmount( ) = flDuckAmount;
    pPlayer->m_iEFlags( ) = iEFlags;

    return pPlayer->InvalidatePhysicsRecursive( ANIMATION_CHANGED );
}


C-like:
UpdatePlayerAnimations( pRecord->m_pPlayer, pRecord, pPreviousRecord, 1, true);
// Ваше :
{
    std::memcpy( pRecord.ResolverLayers[1], pPlayer->GetAnimationLayers( ), sizeof( C_AnimationLayer ) * 13 );
}
INFO : Код порчеса внезапно отличается от кода актуального вантапа !!!!
Норм челики это заметили по одной вещи, а остальным соболезную
слушай я догадался очень поздно я забил ну и все вот что делает ресик в4 (скажи мне спасибо что я его откопал и скинул азузиксу)
это конечно супер круто, но теперь челы пойдут возьмут на серьезе пойдут пастить ресольвер в2, сделают премиум ресольвер в5, добавят 6 дельт, где 3 дельты это проверка на лбу, влепят антифристенд, добавят миллион проверок на автоволл чтобы чит хитал, спастят бектрек ресольвер и будет их чит хитать на все 100 :CoolCat: :CoolCat: :CoolCat: :CoolCat: :CoolCat: :CoolCat: :CoolCat: . но и тут их ждет кое-какая подстава с аним ресольвером)))))) ( не бейте это шутка, но это вам не поможет)
не не они пойдут с азузикса пастить (- фпс)
$$ Moneytalk comunity $$$​
Тема была создана по фану т.к половина югейма не знает даже как анимки обновить и наконец-то завести все таки этот ваш ресольвер вантапа...
Для особо одаренных профорсить m_flGoalFeetYaw = Yaw + 60 вам не достаточно, необходимо обовлять каждый чокнутый тик....


C++:
void C_AnimSync::UpdatePlayerAnimations( C_BasePlayer* pPlayer, C_LagRecord m_LatestRecord, C_LagRecord m_PreviousRecord, int32_t iRotateSide, bool bRotatePlayer )
{
    float_t flCurTime = g_GlobalVars->m_flCurTime;
    float_t flRealTime = g_GlobalVars->m_flRealTime;
    int32_t iFrameCount = g_GlobalVars->m_iFrameCount;
    int32_t iTickCount = g_GlobalVars->m_iTickCount;
    float_t flFrameTime = g_GlobalVars->m_flFrameTime;
    float_t flAbsFrameTime = g_GlobalVars->m_flAbsFrameTime;
    float_t flInterpolation = g_GlobalVars->m_flInterpolationAmount;

    float_t flDuckAmount = pPlayer->m_flDuckAmount( );
    int32_t iEFlags = pPlayer->m_iEFlags( );
    QAngle angEyeAngles = pPlayer->GetCSPlayer( )->m_angEyeAngles( );
    float_t flLowerBodyYaw = pPlayer->GetCSPlayer( )->m_flLowerBodyYaw( );

    float_t flFeetCycle = pPlayer->GetAnimationState( )->m_flFeetCycle;
    float_t flFeetWeight = pPlayer->GetAnimationState( )->m_flFeetWeight;

    pPlayer->m_iEFlags( ) &= ~EFL_DIRTY_ABSVELOCITY;
    pPlayer->m_fFlags( ) = m_LatestRecord.m_Flags;
    pPlayer->m_vecVelocity( ) = m_LatestRecord.m_Velocity;
    pPlayer->m_vecAbsVelocity( ) = m_LatestRecord.m_Velocity;

    pPlayer->SetAbsOrigin( m_LatestRecord.m_Origin );
    if ( g_PlayerData[ pPlayer->EntIndex( ) ].m_bHasPreviousRecord )
    {
        pPlayer->GetAnimationState( )->m_iStrafeSequence = m_PreviousRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_STRAFECHANGE ).m_nSequence;
        pPlayer->GetAnimationState( )->m_flStrafeCycle = m_PreviousRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_STRAFECHANGE ).m_flCycle;
        pPlayer->GetAnimationState( )->m_flStrafeWeight = m_PreviousRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_STRAFECHANGE ).m_flWeight;
        pPlayer->GetAnimationState( )->m_flFeetCycle = m_PreviousRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_MOVE ).m_flCycle;
        pPlayer->GetAnimationState( )->m_flFeetWeight = m_PreviousRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_MOVE ).m_flWeight;
        pPlayer->GetAnimationState( )->m_flLeanYaw = m_PreviousRecord.m_AnimationLayers.at( ANIMATION_LAYER_LEAN ).m_flWeight;

        std::memcpy( pPlayer->GetAnimationLayers( ), m_PreviousRecord.m_AnimationLayers.data( ), sizeof( C_AnimationLayer ) * 13 );
    }
    else
    {
        pPlayer->GetAnimationState( )->m_iStrafeSequence = m_LatestRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_STRAFECHANGE ).m_nSequence;
        pPlayer->GetAnimationState( )->m_flStrafeCycle = m_LatestRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_STRAFECHANGE ).m_flCycle;
        pPlayer->GetAnimationState( )->m_flStrafeWeight = m_LatestRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_STRAFECHANGE ).m_flWeight;
        pPlayer->GetAnimationState( )->m_flFeetCycle = m_LatestRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_MOVE ).m_flCycle;
        pPlayer->GetAnimationState( )->m_flFeetWeight = m_LatestRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_MOVE ).m_flWeight;
        pPlayer->GetAnimationState( )->m_flLeanYaw = m_LatestRecord.m_AnimationLayers.at( ANIMATION_LAYER_LEAN ).m_flWeight;

        pPlayer->GetAnimationState( )->m_flLastClientSideAnimationUpdateTime = m_LatestRecord.m_SimulationTime - TICKS_TO_TIME( m_LatestRecord.m_ChokedTicks );
        if ( m_LatestRecord.m_Flags & FL_ONGROUND )
        {
            pPlayer->GetAnimationState( )->m_bOnGround = true;
            pPlayer->GetAnimationState( )->m_bInHitGroundAnimation = false;
        }

        pPlayer->GetAnimationState( )->m_flTotalTimeInAir = 0.0f;
    }

    if ( m_LatestRecord.m_ChokedTicks <= 1 )
    {
        g_GlobalVars->m_flCurTime = m_LatestRecord.m_SimulationTime;
        g_GlobalVars->m_flRealTime = m_LatestRecord.m_SimulationTime;
        g_GlobalVars->m_flFrameTime = g_GlobalVars->m_flIntervalPerTick;
        g_GlobalVars->m_flAbsFrameTime = g_GlobalVars->m_flIntervalPerTick;
        g_GlobalVars->m_iFrameCount = TIME_TO_TICKS( m_LatestRecord.m_SimulationTime );
        g_GlobalVars->m_iTickCount = TIME_TO_TICKS( m_LatestRecord.m_SimulationTime );
        g_GlobalVars->m_flInterpolationAmount = 0.0f;

        if ( pPlayer->GetAnimationState( )->m_iLastClientSideAnimationUpdateFramecount >= g_GlobalVars->m_iTickCount )
            pPlayer->GetAnimationState( )->m_iLastClientSideAnimationUpdateFramecount = g_GlobalVars->m_iFrameCount - 1;

        if ( bRotatePlayer )
        {
            float_t flEyeYaw = 0.0f;
            if ( iRotateSide < 0 )
                flEyeYaw = m_LatestRecord.m_EyeAngles.yaw - 60.0f;
            else if ( iRotateSide > 0 )
                flEyeYaw = m_LatestRecord.m_EyeAngles.yaw + 60.0f;
            else
                flEyeYaw = m_LatestRecord.m_EyeAngles.yaw;
   
            pPlayer->GetAnimationState( )->m_flGoalFeetYaw = Math::NormalizeAngle( flEyeYaw );
        }

        pPlayer->GetCSPlayer( )->m_angEyeAngles( ) = m_LatestRecord.m_EyeAngles;
        pPlayer->GetCSPlayer( )->m_flLowerBodyYaw( ) = m_LatestRecord.m_LowerBodyYaw;
        pPlayer->m_flDuckAmount( ) = m_LatestRecord.m_DuckAmount;

        for ( int i = 0; i < 13; i++ )
            pPlayer->GetAnimationLayers( )[ i ].m_pOwner = pPlayer;
   
        bool bClientSideAnimation = pPlayer->GetBaseAnimating( )->m_bClientSideAnimation( );
        g_Globals.m_AnimationData.m_bUpdateClientSideAnimation = pPlayer->GetBaseAnimating( )->m_bClientSideAnimation( ) = true;
        ( ( void( __thiscall* )( void* ) )( g_Globals.m_AddressList.UpdateClientSideAnimation ) )( pPlayer );
        g_Globals.m_AnimationData.m_bUpdateClientSideAnimation = false;
        pPlayer->GetBaseAnimating( )->m_bClientSideAnimation( ) = bClientSideAnimation;

        g_GlobalVars->m_flCurTime = flCurTime;
        g_GlobalVars->m_flRealTime = flRealTime;
        g_GlobalVars->m_flFrameTime = flFrameTime;
        g_GlobalVars->m_flAbsFrameTime = flAbsFrameTime;
        g_GlobalVars->m_iFrameCount = iFrameCount;
        g_GlobalVars->m_iTickCount = iTickCount;
        g_GlobalVars->m_flInterpolationAmount = flInterpolation;
    }
    else
    {
        int32_t iSimulationTick = 1;
        do
        {
            float_t flSimulationTime = pPlayer->m_flOldSimulationTime( ) + TICKS_TO_TIME( iSimulationTick );
            if ( g_PlayerData[ pPlayer->EntIndex( ) ].m_bHasPreviousRecord )
                flSimulationTime = g_PlayerData[ pPlayer->EntIndex( ) ].m_PreviousRecord.m_SimulationTime + TICKS_TO_TIME( iSimulationTick );

            g_GlobalVars->m_flCurTime = flSimulationTime;
            g_GlobalVars->m_flRealTime = flSimulationTime;
            g_GlobalVars->m_flFrameTime = g_GlobalVars->m_flIntervalPerTick;
            g_GlobalVars->m_flAbsFrameTime = g_GlobalVars->m_flIntervalPerTick;
            g_GlobalVars->m_iFrameCount = TIME_TO_TICKS( flSimulationTime );
            g_GlobalVars->m_iTickCount = TIME_TO_TICKS( flSimulationTime );
            g_GlobalVars->m_flInterpolationAmount = 0.0f;

            if ( pPlayer->GetAnimationState( )->m_iLastClientSideAnimationUpdateFramecount >= g_GlobalVars->m_iTickCount )
                pPlayer->GetAnimationState( )->m_iLastClientSideAnimationUpdateFramecount = g_GlobalVars->m_iFrameCount - 1;

            if ( bRotatePlayer )
            {
                float_t flEyeYaw = 0.0f;
                if ( iRotateSide < 0 )
                    flEyeYaw = m_LatestRecord.m_EyeAngles.yaw - 60.0f;
                else if ( iRotateSide > 0 )
                    flEyeYaw = m_LatestRecord.m_EyeAngles.yaw + 60.0f;
                else
                    flEyeYaw = m_LatestRecord.m_EyeAngles.yaw;
   
                pPlayer->GetAnimationState( )->m_flGoalFeetYaw = Math::NormalizeAngle( flEyeYaw );
            }

            if ( m_LatestRecord.m_DuckPerTick )
                pPlayer->m_flDuckAmount( ) += m_LatestRecord.m_DuckPerTick * iSimulationTick;
   
            for ( int i = 0; i < 13; i++ )
                pPlayer->GetAnimationLayers( )[ i ].m_pOwner = pPlayer;

            bool bClientSideAnimation = pPlayer->GetBaseAnimating( )->m_bClientSideAnimation( );
            g_Globals.m_AnimationData.m_bUpdateClientSideAnimation = pPlayer->GetBaseAnimating( )->m_bClientSideAnimation( ) = true;
            ( ( void( __thiscall* )( void* ) )( g_Globals.m_AddressList.UpdateClientSideAnimation ) )( pPlayer );
            g_Globals.m_AnimationData.m_bUpdateClientSideAnimation = false;
            pPlayer->GetBaseAnimating( )->m_bClientSideAnimation( ) = bClientSideAnimation;

            g_GlobalVars->m_flCurTime = flCurTime;
            g_GlobalVars->m_flRealTime = flRealTime;
            g_GlobalVars->m_flFrameTime = flFrameTime;
            g_GlobalVars->m_flAbsFrameTime = flAbsFrameTime;
            g_GlobalVars->m_iFrameCount = iFrameCount;
            g_GlobalVars->m_iTickCount = iTickCount;
            g_GlobalVars->m_flInterpolationAmount = flInterpolation;

            // increase simulation tick
            iSimulationTick++;
        }
        while ( iSimulationTick <= m_LatestRecord.m_ChokedTicks );
    }

    g_GlobalVars->m_flCurTime = flCurTime;
    g_GlobalVars->m_flRealTime = flRealTime;
    g_GlobalVars->m_flFrameTime = flFrameTime;
    g_GlobalVars->m_flAbsFrameTime = flAbsFrameTime;
    g_GlobalVars->m_iFrameCount = iFrameCount;
    g_GlobalVars->m_iTickCount = iTickCount;
    g_GlobalVars->m_flInterpolationAmount = flInterpolation;

    pPlayer->GetAnimationState( )->m_flFeetCycle = flFeetCycle;
    pPlayer->GetAnimationState( )->m_flFeetWeight = flFeetWeight;

    pPlayer->GetCSPlayer( )->m_angEyeAngles( ) = angEyeAngles;
    pPlayer->GetCSPlayer( )->m_flLowerBodyYaw( ) = flLowerBodyYaw;
    pPlayer->m_flDuckAmount( ) = flDuckAmount;
    pPlayer->m_iEFlags( ) = iEFlags;

    return pPlayer->InvalidatePhysicsRecursive( ANIMATION_CHANGED );
}


C-like:
UpdatePlayerAnimations( pRecord->m_pPlayer, pRecord, pPreviousRecord, 1, true);
// Ваше :
{
    std::memcpy( pRecord.ResolverLayers[1], pPlayer->GetAnimationLayers( ), sizeof( C_AnimationLayer ) * 13 );
}
INFO : Код порчеса внезапно отличается от кода актуального вантапа !!!!
Норм челики это заметили по одной вещи, а остальным соболезную
для пастеров обьясни куда кидать наверное пусть поймут или ще таке???
 
Последнее редактирование:
Пользователь
Статус
Оффлайн
Регистрация
3 Янв 2020
Сообщения
83
Реакции[?]
102
Поинты[?]
6K
$$ Moneytalk comunity $$$​
Тема была создана по фану т.к половина югейма не знает даже как анимки обновить и наконец-то завести все таки этот ваш ресольвер вантапа...
Для особо одаренных профорсить m_flGoalFeetYaw = Yaw + 60 вам не достаточно, необходимо обовлять каждый чокнутый тик....


C++:
void C_AnimSync::UpdatePlayerAnimations( C_BasePlayer* pPlayer, C_LagRecord m_LatestRecord, C_LagRecord m_PreviousRecord, int32_t iRotateSide, bool bRotatePlayer )
{
    float_t flCurTime = g_GlobalVars->m_flCurTime;
    float_t flRealTime = g_GlobalVars->m_flRealTime;
    int32_t iFrameCount = g_GlobalVars->m_iFrameCount;
    int32_t iTickCount = g_GlobalVars->m_iTickCount;
    float_t flFrameTime = g_GlobalVars->m_flFrameTime;
    float_t flAbsFrameTime = g_GlobalVars->m_flAbsFrameTime;
    float_t flInterpolation = g_GlobalVars->m_flInterpolationAmount;

    float_t flDuckAmount = pPlayer->m_flDuckAmount( );
    int32_t iEFlags = pPlayer->m_iEFlags( );
    QAngle angEyeAngles = pPlayer->GetCSPlayer( )->m_angEyeAngles( );
    float_t flLowerBodyYaw = pPlayer->GetCSPlayer( )->m_flLowerBodyYaw( );

    float_t flFeetCycle = pPlayer->GetAnimationState( )->m_flFeetCycle;
    float_t flFeetWeight = pPlayer->GetAnimationState( )->m_flFeetWeight;

    pPlayer->m_iEFlags( ) &= ~EFL_DIRTY_ABSVELOCITY;
    pPlayer->m_fFlags( ) = m_LatestRecord.m_Flags;
    pPlayer->m_vecVelocity( ) = m_LatestRecord.m_Velocity;
    pPlayer->m_vecAbsVelocity( ) = m_LatestRecord.m_Velocity;

    pPlayer->SetAbsOrigin( m_LatestRecord.m_Origin );
    if ( g_PlayerData[ pPlayer->EntIndex( ) ].m_bHasPreviousRecord )
    {
        pPlayer->GetAnimationState( )->m_iStrafeSequence = m_PreviousRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_STRAFECHANGE ).m_nSequence;
        pPlayer->GetAnimationState( )->m_flStrafeCycle = m_PreviousRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_STRAFECHANGE ).m_flCycle;
        pPlayer->GetAnimationState( )->m_flStrafeWeight = m_PreviousRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_STRAFECHANGE ).m_flWeight;
        pPlayer->GetAnimationState( )->m_flFeetCycle = m_PreviousRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_MOVE ).m_flCycle;
        pPlayer->GetAnimationState( )->m_flFeetWeight = m_PreviousRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_MOVE ).m_flWeight;
        pPlayer->GetAnimationState( )->m_flLeanYaw = m_PreviousRecord.m_AnimationLayers.at( ANIMATION_LAYER_LEAN ).m_flWeight;

        std::memcpy( pPlayer->GetAnimationLayers( ), m_PreviousRecord.m_AnimationLayers.data( ), sizeof( C_AnimationLayer ) * 13 );
    }
    else
    {
        pPlayer->GetAnimationState( )->m_iStrafeSequence = m_LatestRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_STRAFECHANGE ).m_nSequence;
        pPlayer->GetAnimationState( )->m_flStrafeCycle = m_LatestRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_STRAFECHANGE ).m_flCycle;
        pPlayer->GetAnimationState( )->m_flStrafeWeight = m_LatestRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_STRAFECHANGE ).m_flWeight;
        pPlayer->GetAnimationState( )->m_flFeetCycle = m_LatestRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_MOVE ).m_flCycle;
        pPlayer->GetAnimationState( )->m_flFeetWeight = m_LatestRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_MOVE ).m_flWeight;
        pPlayer->GetAnimationState( )->m_flLeanYaw = m_LatestRecord.m_AnimationLayers.at( ANIMATION_LAYER_LEAN ).m_flWeight;

        pPlayer->GetAnimationState( )->m_flLastClientSideAnimationUpdateTime = m_LatestRecord.m_SimulationTime - TICKS_TO_TIME( m_LatestRecord.m_ChokedTicks );
        if ( m_LatestRecord.m_Flags & FL_ONGROUND )
        {
            pPlayer->GetAnimationState( )->m_bOnGround = true;
            pPlayer->GetAnimationState( )->m_bInHitGroundAnimation = false;
        }

        pPlayer->GetAnimationState( )->m_flTotalTimeInAir = 0.0f;
    }

    if ( m_LatestRecord.m_ChokedTicks <= 1 )
    {
        g_GlobalVars->m_flCurTime = m_LatestRecord.m_SimulationTime;
        g_GlobalVars->m_flRealTime = m_LatestRecord.m_SimulationTime;
        g_GlobalVars->m_flFrameTime = g_GlobalVars->m_flIntervalPerTick;
        g_GlobalVars->m_flAbsFrameTime = g_GlobalVars->m_flIntervalPerTick;
        g_GlobalVars->m_iFrameCount = TIME_TO_TICKS( m_LatestRecord.m_SimulationTime );
        g_GlobalVars->m_iTickCount = TIME_TO_TICKS( m_LatestRecord.m_SimulationTime );
        g_GlobalVars->m_flInterpolationAmount = 0.0f;

        if ( pPlayer->GetAnimationState( )->m_iLastClientSideAnimationUpdateFramecount >= g_GlobalVars->m_iTickCount )
            pPlayer->GetAnimationState( )->m_iLastClientSideAnimationUpdateFramecount = g_GlobalVars->m_iFrameCount - 1;

        if ( bRotatePlayer )
        {
            float_t flEyeYaw = 0.0f;
            if ( iRotateSide < 0 )
                flEyeYaw = m_LatestRecord.m_EyeAngles.yaw - 60.0f;
            else if ( iRotateSide > 0 )
                flEyeYaw = m_LatestRecord.m_EyeAngles.yaw + 60.0f;
            else
                flEyeYaw = m_LatestRecord.m_EyeAngles.yaw;

            pPlayer->GetAnimationState( )->m_flGoalFeetYaw = Math::NormalizeAngle( flEyeYaw );
        }

        pPlayer->GetCSPlayer( )->m_angEyeAngles( ) = m_LatestRecord.m_EyeAngles;
        pPlayer->GetCSPlayer( )->m_flLowerBodyYaw( ) = m_LatestRecord.m_LowerBodyYaw;
        pPlayer->m_flDuckAmount( ) = m_LatestRecord.m_DuckAmount;

        for ( int i = 0; i < 13; i++ )
            pPlayer->GetAnimationLayers( )[ i ].m_pOwner = pPlayer;

        bool bClientSideAnimation = pPlayer->GetBaseAnimating( )->m_bClientSideAnimation( );
        g_Globals.m_AnimationData.m_bUpdateClientSideAnimation = pPlayer->GetBaseAnimating( )->m_bClientSideAnimation( ) = true;
        ( ( void( __thiscall* )( void* ) )( g_Globals.m_AddressList.UpdateClientSideAnimation ) )( pPlayer );
        g_Globals.m_AnimationData.m_bUpdateClientSideAnimation = false;
        pPlayer->GetBaseAnimating( )->m_bClientSideAnimation( ) = bClientSideAnimation;

        g_GlobalVars->m_flCurTime = flCurTime;
        g_GlobalVars->m_flRealTime = flRealTime;
        g_GlobalVars->m_flFrameTime = flFrameTime;
        g_GlobalVars->m_flAbsFrameTime = flAbsFrameTime;
        g_GlobalVars->m_iFrameCount = iFrameCount;
        g_GlobalVars->m_iTickCount = iTickCount;
        g_GlobalVars->m_flInterpolationAmount = flInterpolation;
    }
    else
    {
        int32_t iSimulationTick = 1;
        do
        {
            float_t flSimulationTime = pPlayer->m_flOldSimulationTime( ) + TICKS_TO_TIME( iSimulationTick );
            if ( g_PlayerData[ pPlayer->EntIndex( ) ].m_bHasPreviousRecord )
                flSimulationTime = g_PlayerData[ pPlayer->EntIndex( ) ].m_PreviousRecord.m_SimulationTime + TICKS_TO_TIME( iSimulationTick );

            g_GlobalVars->m_flCurTime = flSimulationTime;
            g_GlobalVars->m_flRealTime = flSimulationTime;
            g_GlobalVars->m_flFrameTime = g_GlobalVars->m_flIntervalPerTick;
            g_GlobalVars->m_flAbsFrameTime = g_GlobalVars->m_flIntervalPerTick;
            g_GlobalVars->m_iFrameCount = TIME_TO_TICKS( flSimulationTime );
            g_GlobalVars->m_iTickCount = TIME_TO_TICKS( flSimulationTime );
            g_GlobalVars->m_flInterpolationAmount = 0.0f;

            if ( pPlayer->GetAnimationState( )->m_iLastClientSideAnimationUpdateFramecount >= g_GlobalVars->m_iTickCount )
                pPlayer->GetAnimationState( )->m_iLastClientSideAnimationUpdateFramecount = g_GlobalVars->m_iFrameCount - 1;

            if ( bRotatePlayer )
            {
                float_t flEyeYaw = 0.0f;
                if ( iRotateSide < 0 )
                    flEyeYaw = m_LatestRecord.m_EyeAngles.yaw - 60.0f;
                else if ( iRotateSide > 0 )
                    flEyeYaw = m_LatestRecord.m_EyeAngles.yaw + 60.0f;
                else
                    flEyeYaw = m_LatestRecord.m_EyeAngles.yaw;

                pPlayer->GetAnimationState( )->m_flGoalFeetYaw = Math::NormalizeAngle( flEyeYaw );
            }

            if ( m_LatestRecord.m_DuckPerTick )
                pPlayer->m_flDuckAmount( ) += m_LatestRecord.m_DuckPerTick * iSimulationTick;

            for ( int i = 0; i < 13; i++ )
                pPlayer->GetAnimationLayers( )[ i ].m_pOwner = pPlayer;

            bool bClientSideAnimation = pPlayer->GetBaseAnimating( )->m_bClientSideAnimation( );
            g_Globals.m_AnimationData.m_bUpdateClientSideAnimation = pPlayer->GetBaseAnimating( )->m_bClientSideAnimation( ) = true;
            ( ( void( __thiscall* )( void* ) )( g_Globals.m_AddressList.UpdateClientSideAnimation ) )( pPlayer );
            g_Globals.m_AnimationData.m_bUpdateClientSideAnimation = false;
            pPlayer->GetBaseAnimating( )->m_bClientSideAnimation( ) = bClientSideAnimation;

            g_GlobalVars->m_flCurTime = flCurTime;
            g_GlobalVars->m_flRealTime = flRealTime;
            g_GlobalVars->m_flFrameTime = flFrameTime;
            g_GlobalVars->m_flAbsFrameTime = flAbsFrameTime;
            g_GlobalVars->m_iFrameCount = iFrameCount;
            g_GlobalVars->m_iTickCount = iTickCount;
            g_GlobalVars->m_flInterpolationAmount = flInterpolation;

            // increase simulation tick
            iSimulationTick++;
        }
        while ( iSimulationTick <= m_LatestRecord.m_ChokedTicks );
    }

    g_GlobalVars->m_flCurTime = flCurTime;
    g_GlobalVars->m_flRealTime = flRealTime;
    g_GlobalVars->m_flFrameTime = flFrameTime;
    g_GlobalVars->m_flAbsFrameTime = flAbsFrameTime;
    g_GlobalVars->m_iFrameCount = iFrameCount;
    g_GlobalVars->m_iTickCount = iTickCount;
    g_GlobalVars->m_flInterpolationAmount = flInterpolation;

    pPlayer->GetAnimationState( )->m_flFeetCycle = flFeetCycle;
    pPlayer->GetAnimationState( )->m_flFeetWeight = flFeetWeight;

    pPlayer->GetCSPlayer( )->m_angEyeAngles( ) = angEyeAngles;
    pPlayer->GetCSPlayer( )->m_flLowerBodyYaw( ) = flLowerBodyYaw;
    pPlayer->m_flDuckAmount( ) = flDuckAmount;
    pPlayer->m_iEFlags( ) = iEFlags;

    return pPlayer->InvalidatePhysicsRecursive( ANIMATION_CHANGED );
}


C-like:
UpdatePlayerAnimations( pRecord->m_pPlayer, pRecord, pPreviousRecord, 1, true);
// Ваше :
{
    std::memcpy( pRecord.ResolverLayers[1], pPlayer->GetAnimationLayers( ), sizeof( C_AnimationLayer ) * 13 );
}
INFO : Код порчеса внезапно отличается от кода актуального вантапа !!!!
Норм челики это заметили по одной вещи, а остальным соболезную
lol someone actually posted this, you dident even provide the rest of the code to this XD
 
Последнее редактирование:
Эксперт
Статус
Оффлайн
Регистрация
17 Фев 2017
Сообщения
864
Реакции[?]
420
Поинты[?]
1K
$$ Moneytalk comunity $$$​
Тема была создана по фану т.к половина югейма не знает даже как анимки обновить и наконец-то завести все таки этот ваш ресольвер вантапа...
Для особо одаренных профорсить m_flGoalFeetYaw = Yaw + 60 вам не достаточно, необходимо обовлять каждый чокнутый тик....


C++:
void C_AnimSync::UpdatePlayerAnimations( C_BasePlayer* pPlayer, C_LagRecord m_LatestRecord, C_LagRecord m_PreviousRecord, int32_t iRotateSide, bool bRotatePlayer )
{
    float_t flCurTime = g_GlobalVars->m_flCurTime;
    float_t flRealTime = g_GlobalVars->m_flRealTime;
    int32_t iFrameCount = g_GlobalVars->m_iFrameCount;
    int32_t iTickCount = g_GlobalVars->m_iTickCount;
    float_t flFrameTime = g_GlobalVars->m_flFrameTime;
    float_t flAbsFrameTime = g_GlobalVars->m_flAbsFrameTime;
    float_t flInterpolation = g_GlobalVars->m_flInterpolationAmount;

    float_t flDuckAmount = pPlayer->m_flDuckAmount( );
    int32_t iEFlags = pPlayer->m_iEFlags( );
    QAngle angEyeAngles = pPlayer->GetCSPlayer( )->m_angEyeAngles( );
    float_t flLowerBodyYaw = pPlayer->GetCSPlayer( )->m_flLowerBodyYaw( );

    float_t flFeetCycle = pPlayer->GetAnimationState( )->m_flFeetCycle;
    float_t flFeetWeight = pPlayer->GetAnimationState( )->m_flFeetWeight;

    pPlayer->m_iEFlags( ) &= ~EFL_DIRTY_ABSVELOCITY;
    pPlayer->m_fFlags( ) = m_LatestRecord.m_Flags;
    pPlayer->m_vecVelocity( ) = m_LatestRecord.m_Velocity;
    pPlayer->m_vecAbsVelocity( ) = m_LatestRecord.m_Velocity;

    pPlayer->SetAbsOrigin( m_LatestRecord.m_Origin );
    if ( g_PlayerData[ pPlayer->EntIndex( ) ].m_bHasPreviousRecord )
    {
        pPlayer->GetAnimationState( )->m_iStrafeSequence = m_PreviousRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_STRAFECHANGE ).m_nSequence;
        pPlayer->GetAnimationState( )->m_flStrafeCycle = m_PreviousRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_STRAFECHANGE ).m_flCycle;
        pPlayer->GetAnimationState( )->m_flStrafeWeight = m_PreviousRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_STRAFECHANGE ).m_flWeight;
        pPlayer->GetAnimationState( )->m_flFeetCycle = m_PreviousRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_MOVE ).m_flCycle;
        pPlayer->GetAnimationState( )->m_flFeetWeight = m_PreviousRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_MOVE ).m_flWeight;
        pPlayer->GetAnimationState( )->m_flLeanYaw = m_PreviousRecord.m_AnimationLayers.at( ANIMATION_LAYER_LEAN ).m_flWeight;

        std::memcpy( pPlayer->GetAnimationLayers( ), m_PreviousRecord.m_AnimationLayers.data( ), sizeof( C_AnimationLayer ) * 13 );
    }
    else
    {
        pPlayer->GetAnimationState( )->m_iStrafeSequence = m_LatestRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_STRAFECHANGE ).m_nSequence;
        pPlayer->GetAnimationState( )->m_flStrafeCycle = m_LatestRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_STRAFECHANGE ).m_flCycle;
        pPlayer->GetAnimationState( )->m_flStrafeWeight = m_LatestRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_STRAFECHANGE ).m_flWeight;
        pPlayer->GetAnimationState( )->m_flFeetCycle = m_LatestRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_MOVE ).m_flCycle;
        pPlayer->GetAnimationState( )->m_flFeetWeight = m_LatestRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_MOVE ).m_flWeight;
        pPlayer->GetAnimationState( )->m_flLeanYaw = m_LatestRecord.m_AnimationLayers.at( ANIMATION_LAYER_LEAN ).m_flWeight;

        pPlayer->GetAnimationState( )->m_flLastClientSideAnimationUpdateTime = m_LatestRecord.m_SimulationTime - TICKS_TO_TIME( m_LatestRecord.m_ChokedTicks );
        if ( m_LatestRecord.m_Flags & FL_ONGROUND )
        {
            pPlayer->GetAnimationState( )->m_bOnGround = true;
            pPlayer->GetAnimationState( )->m_bInHitGroundAnimation = false;
        }

        pPlayer->GetAnimationState( )->m_flTotalTimeInAir = 0.0f;
    }

    if ( m_LatestRecord.m_ChokedTicks <= 1 )
    {
        g_GlobalVars->m_flCurTime = m_LatestRecord.m_SimulationTime;
        g_GlobalVars->m_flRealTime = m_LatestRecord.m_SimulationTime;
        g_GlobalVars->m_flFrameTime = g_GlobalVars->m_flIntervalPerTick;
        g_GlobalVars->m_flAbsFrameTime = g_GlobalVars->m_flIntervalPerTick;
        g_GlobalVars->m_iFrameCount = TIME_TO_TICKS( m_LatestRecord.m_SimulationTime );
        g_GlobalVars->m_iTickCount = TIME_TO_TICKS( m_LatestRecord.m_SimulationTime );
        g_GlobalVars->m_flInterpolationAmount = 0.0f;

        if ( pPlayer->GetAnimationState( )->m_iLastClientSideAnimationUpdateFramecount >= g_GlobalVars->m_iTickCount )
            pPlayer->GetAnimationState( )->m_iLastClientSideAnimationUpdateFramecount = g_GlobalVars->m_iFrameCount - 1;

        if ( bRotatePlayer )
        {
            float_t flEyeYaw = 0.0f;
            if ( iRotateSide < 0 )
                flEyeYaw = m_LatestRecord.m_EyeAngles.yaw - 60.0f;
            else if ( iRotateSide > 0 )
                flEyeYaw = m_LatestRecord.m_EyeAngles.yaw + 60.0f;
            else
                flEyeYaw = m_LatestRecord.m_EyeAngles.yaw;
   
            pPlayer->GetAnimationState( )->m_flGoalFeetYaw = Math::NormalizeAngle( flEyeYaw );
        }

        pPlayer->GetCSPlayer( )->m_angEyeAngles( ) = m_LatestRecord.m_EyeAngles;
        pPlayer->GetCSPlayer( )->m_flLowerBodyYaw( ) = m_LatestRecord.m_LowerBodyYaw;
        pPlayer->m_flDuckAmount( ) = m_LatestRecord.m_DuckAmount;

        for ( int i = 0; i < 13; i++ )
            pPlayer->GetAnimationLayers( )[ i ].m_pOwner = pPlayer;
   
        bool bClientSideAnimation = pPlayer->GetBaseAnimating( )->m_bClientSideAnimation( );
        g_Globals.m_AnimationData.m_bUpdateClientSideAnimation = pPlayer->GetBaseAnimating( )->m_bClientSideAnimation( ) = true;
        ( ( void( __thiscall* )( void* ) )( g_Globals.m_AddressList.UpdateClientSideAnimation ) )( pPlayer );
        g_Globals.m_AnimationData.m_bUpdateClientSideAnimation = false;
        pPlayer->GetBaseAnimating( )->m_bClientSideAnimation( ) = bClientSideAnimation;

        g_GlobalVars->m_flCurTime = flCurTime;
        g_GlobalVars->m_flRealTime = flRealTime;
        g_GlobalVars->m_flFrameTime = flFrameTime;
        g_GlobalVars->m_flAbsFrameTime = flAbsFrameTime;
        g_GlobalVars->m_iFrameCount = iFrameCount;
        g_GlobalVars->m_iTickCount = iTickCount;
        g_GlobalVars->m_flInterpolationAmount = flInterpolation;
    }
    else
    {
        int32_t iSimulationTick = 1;
        do
        {
            float_t flSimulationTime = pPlayer->m_flOldSimulationTime( ) + TICKS_TO_TIME( iSimulationTick );
            if ( g_PlayerData[ pPlayer->EntIndex( ) ].m_bHasPreviousRecord )
                flSimulationTime = g_PlayerData[ pPlayer->EntIndex( ) ].m_PreviousRecord.m_SimulationTime + TICKS_TO_TIME( iSimulationTick );

            g_GlobalVars->m_flCurTime = flSimulationTime;
            g_GlobalVars->m_flRealTime = flSimulationTime;
            g_GlobalVars->m_flFrameTime = g_GlobalVars->m_flIntervalPerTick;
            g_GlobalVars->m_flAbsFrameTime = g_GlobalVars->m_flIntervalPerTick;
            g_GlobalVars->m_iFrameCount = TIME_TO_TICKS( flSimulationTime );
            g_GlobalVars->m_iTickCount = TIME_TO_TICKS( flSimulationTime );
            g_GlobalVars->m_flInterpolationAmount = 0.0f;

            if ( pPlayer->GetAnimationState( )->m_iLastClientSideAnimationUpdateFramecount >= g_GlobalVars->m_iTickCount )
                pPlayer->GetAnimationState( )->m_iLastClientSideAnimationUpdateFramecount = g_GlobalVars->m_iFrameCount - 1;

            if ( bRotatePlayer )
            {
                float_t flEyeYaw = 0.0f;
                if ( iRotateSide < 0 )
                    flEyeYaw = m_LatestRecord.m_EyeAngles.yaw - 60.0f;
                else if ( iRotateSide > 0 )
                    flEyeYaw = m_LatestRecord.m_EyeAngles.yaw + 60.0f;
                else
                    flEyeYaw = m_LatestRecord.m_EyeAngles.yaw;
   
                pPlayer->GetAnimationState( )->m_flGoalFeetYaw = Math::NormalizeAngle( flEyeYaw );
            }

            if ( m_LatestRecord.m_DuckPerTick )
                pPlayer->m_flDuckAmount( ) += m_LatestRecord.m_DuckPerTick * iSimulationTick;
   
            for ( int i = 0; i < 13; i++ )
                pPlayer->GetAnimationLayers( )[ i ].m_pOwner = pPlayer;

            bool bClientSideAnimation = pPlayer->GetBaseAnimating( )->m_bClientSideAnimation( );
            g_Globals.m_AnimationData.m_bUpdateClientSideAnimation = pPlayer->GetBaseAnimating( )->m_bClientSideAnimation( ) = true;
            ( ( void( __thiscall* )( void* ) )( g_Globals.m_AddressList.UpdateClientSideAnimation ) )( pPlayer );
            g_Globals.m_AnimationData.m_bUpdateClientSideAnimation = false;
            pPlayer->GetBaseAnimating( )->m_bClientSideAnimation( ) = bClientSideAnimation;

            g_GlobalVars->m_flCurTime = flCurTime;
            g_GlobalVars->m_flRealTime = flRealTime;
            g_GlobalVars->m_flFrameTime = flFrameTime;
            g_GlobalVars->m_flAbsFrameTime = flAbsFrameTime;
            g_GlobalVars->m_iFrameCount = iFrameCount;
            g_GlobalVars->m_iTickCount = iTickCount;
            g_GlobalVars->m_flInterpolationAmount = flInterpolation;

            // increase simulation tick
            iSimulationTick++;
        }
        while ( iSimulationTick <= m_LatestRecord.m_ChokedTicks );
    }

    g_GlobalVars->m_flCurTime = flCurTime;
    g_GlobalVars->m_flRealTime = flRealTime;
    g_GlobalVars->m_flFrameTime = flFrameTime;
    g_GlobalVars->m_flAbsFrameTime = flAbsFrameTime;
    g_GlobalVars->m_iFrameCount = iFrameCount;
    g_GlobalVars->m_iTickCount = iTickCount;
    g_GlobalVars->m_flInterpolationAmount = flInterpolation;

    pPlayer->GetAnimationState( )->m_flFeetCycle = flFeetCycle;
    pPlayer->GetAnimationState( )->m_flFeetWeight = flFeetWeight;

    pPlayer->GetCSPlayer( )->m_angEyeAngles( ) = angEyeAngles;
    pPlayer->GetCSPlayer( )->m_flLowerBodyYaw( ) = flLowerBodyYaw;
    pPlayer->m_flDuckAmount( ) = flDuckAmount;
    pPlayer->m_iEFlags( ) = iEFlags;

    return pPlayer->InvalidatePhysicsRecursive( ANIMATION_CHANGED );
}


C-like:
UpdatePlayerAnimations( pRecord->m_pPlayer, pRecord, pPreviousRecord, 1, true);
// Ваше :
{
    std::memcpy( pRecord.ResolverLayers[1], pPlayer->GetAnimationLayers( ), sizeof( C_AnimationLayer ) * 13 );
}
INFO : Код порчеса внезапно отличается от кода актуального вантапа !!!!
Норм челики это заметили по одной вещи, а остальным соболезную
Весьма спорный участок кода на мое личное мнение:
Код:
Спойлер: Code
C++:
void C_AnimSync::UpdatePlayerAnimations( C_BasePlayer* pPlayer, C_LagRecord m_LatestRecord, C_LagRecord m_PreviousRecord, int32_t iRotateSide, bool bRotatePlayer )
{
    float_t flCurTime = g_GlobalVars->m_flCurTime;
    float_t flRealTime = g_GlobalVars->m_flRealTime;
    int32_t iFrameCount = g_GlobalVars->m_iFrameCount;
    int32_t iTickCount = g_GlobalVars->m_iTickCount;
    float_t flFrameTime = g_GlobalVars->m_flFrameTime;
    float_t flAbsFrameTime = g_GlobalVars->m_flAbsFrameTime;
    float_t flInterpolation = g_GlobalVars->m_flInterpolationAmount;

    float_t flDuckAmount = pPlayer->m_flDuckAmount( );
    int32_t iEFlags = pPlayer->m_iEFlags( );
    QAngle angEyeAngles = pPlayer->GetCSPlayer( )->m_angEyeAngles( );
    float_t flLowerBodyYaw = pPlayer->GetCSPlayer( )->m_flLowerBodyYaw( );

    float_t flFeetCycle = pPlayer->GetAnimationState( )->m_flFeetCycle;
    float_t flFeetWeight = pPlayer->GetAnimationState( )->m_flFeetWeight;

    pPlayer->m_iEFlags( ) &= ~EFL_DIRTY_ABSVELOCITY;
    pPlayer->m_fFlags( ) = m_LatestRecord.m_Flags;
    pPlayer->m_vecVelocity( ) = m_LatestRecord.m_Velocity;
    pPlayer->m_vecAbsVelocity( ) = m_LatestRecord.m_Velocity;

    pPlayer->SetAbsOrigin( m_LatestRecord.m_Origin );
    if ( g_PlayerData[ pPlayer->EntIndex( ) ].m_bHasPreviousRecord )
    {
        pPlayer->GetAnimationState( )->m_iStrafeSequence = m_PreviousRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_STRAFECHANGE ).m_nSequence;
        pPlayer->GetAnimationState( )->m_flStrafeCycle = m_PreviousRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_STRAFECHANGE ).m_flCycle;
        pPlayer->GetAnimationState( )->m_flStrafeWeight = m_PreviousRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_STRAFECHANGE ).m_flWeight;
        pPlayer->GetAnimationState( )->m_flFeetCycle = m_PreviousRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_MOVE ).m_flCycle;
        pPlayer->GetAnimationState( )->m_flFeetWeight = m_PreviousRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_MOVE ).m_flWeight;
        pPlayer->GetAnimationState( )->m_flLeanYaw = m_PreviousRecord.m_AnimationLayers.at( ANIMATION_LAYER_LEAN ).m_flWeight;

        std::memcpy( pPlayer->GetAnimationLayers( ), m_PreviousRecord.m_AnimationLayers.data( ), sizeof( C_AnimationLayer ) * 13 );
    }
    else
    {
        pPlayer->GetAnimationState( )->m_iStrafeSequence = m_LatestRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_STRAFECHANGE ).m_nSequence;
        pPlayer->GetAnimationState( )->m_flStrafeCycle = m_LatestRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_STRAFECHANGE ).m_flCycle;
        pPlayer->GetAnimationState( )->m_flStrafeWeight = m_LatestRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_STRAFECHANGE ).m_flWeight;
        pPlayer->GetAnimationState( )->m_flFeetCycle = m_LatestRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_MOVE ).m_flCycle;
        pPlayer->GetAnimationState( )->m_flFeetWeight = m_LatestRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_MOVE ).m_flWeight;
        pPlayer->GetAnimationState( )->m_flLeanYaw = m_LatestRecord.m_AnimationLayers.at( ANIMATION_LAYER_LEAN ).m_flWeight;

        pPlayer->GetAnimationState( )->m_flLastClientSideAnimationUpdateTime = m_LatestRecord.m_SimulationTime - TICKS_TO_TIME( m_LatestRecord.m_ChokedTicks );
        if ( m_LatestRecord.m_Flags & FL_ONGROUND )
        {
            pPlayer->GetAnimationState( )->m_bOnGround = true;
            pPlayer->GetAnimationState( )->m_bInHitGroundAnimation = false;
        }

        pPlayer->GetAnimationState( )->m_flTotalTimeInAir = 0.0f;
    }

    if ( m_LatestRecord.m_ChokedTicks <= 1 )
    {
        g_GlobalVars->m_flCurTime = m_LatestRecord.m_SimulationTime;
        g_GlobalVars->m_flRealTime = m_LatestRecord.m_SimulationTime;
        g_GlobalVars->m_flFrameTime = g_GlobalVars->m_flIntervalPerTick;
        g_GlobalVars->m_flAbsFrameTime = g_GlobalVars->m_flIntervalPerTick;
        g_GlobalVars->m_iFrameCount = TIME_TO_TICKS( m_LatestRecord.m_SimulationTime );
        g_GlobalVars->m_iTickCount = TIME_TO_TICKS( m_LatestRecord.m_SimulationTime );
        g_GlobalVars->m_flInterpolationAmount = 0.0f;

        if ( pPlayer->GetAnimationState( )->m_iLastClientSideAnimationUpdateFramecount >= g_GlobalVars->m_iTickCount )
            pPlayer->GetAnimationState( )->m_iLastClientSideAnimationUpdateFramecount = g_GlobalVars->m_iFrameCount - 1;

        if ( bRotatePlayer )
        {
            float_t flEyeYaw = 0.0f;
            if ( iRotateSide < 0 )
                flEyeYaw = m_LatestRecord.m_EyeAngles.yaw - 60.0f;
            else if ( iRotateSide > 0 )
                flEyeYaw = m_LatestRecord.m_EyeAngles.yaw + 60.0f;
            else
                flEyeYaw = m_LatestRecord.m_EyeAngles.yaw;
    
            pPlayer->GetAnimationState( )->m_flGoalFeetYaw = Math::NormalizeAngle( flEyeYaw );
        }

        pPlayer->GetCSPlayer( )->m_angEyeAngles( ) = m_LatestRecord.m_EyeAngles;
        pPlayer->GetCSPlayer( )->m_flLowerBodyYaw( ) = m_LatestRecord.m_LowerBodyYaw;
        pPlayer->m_flDuckAmount( ) = m_LatestRecord.m_DuckAmount;

        for ( int i = 0; i < 13; i++ )
            pPlayer->GetAnimationLayers( )[ i ].m_pOwner = pPlayer;
    
        bool bClientSideAnimation = pPlayer->GetBaseAnimating( )->m_bClientSideAnimation( );
        g_Globals.m_AnimationData.m_bUpdateClientSideAnimation = pPlayer->GetBaseAnimating( )->m_bClientSideAnimation( ) = true;
        ( ( void( __thiscall* )( void* ) )( g_Globals.m_AddressList.UpdateClientSideAnimation ) )( pPlayer );
        g_Globals.m_AnimationData.m_bUpdateClientSideAnimation = false;
        pPlayer->GetBaseAnimating( )->m_bClientSideAnimation( ) = bClientSideAnimation;

        g_GlobalVars->m_flCurTime = flCurTime;
        g_GlobalVars->m_flRealTime = flRealTime;
        g_GlobalVars->m_flFrameTime = flFrameTime;
        g_GlobalVars->m_flAbsFrameTime = flAbsFrameTime;
        g_GlobalVars->m_iFrameCount = iFrameCount;
        g_GlobalVars->m_iTickCount = iTickCount;
        g_GlobalVars->m_flInterpolationAmount = flInterpolation;
    }
    else
    {
        int32_t iSimulationTick = 1;
        do
        {
            float_t flSimulationTime = pPlayer->m_flOldSimulationTime( ) + TICKS_TO_TIME( iSimulationTick );
            if ( g_PlayerData[ pPlayer->EntIndex( ) ].m_bHasPreviousRecord )
                flSimulationTime = g_PlayerData[ pPlayer->EntIndex( ) ].m_PreviousRecord.m_SimulationTime + TICKS_TO_TIME( iSimulationTick );

            g_GlobalVars->m_flCurTime = flSimulationTime;
            g_GlobalVars->m_flRealTime = flSimulationTime;
            g_GlobalVars->m_flFrameTime = g_GlobalVars->m_flIntervalPerTick;
            g_GlobalVars->m_flAbsFrameTime = g_GlobalVars->m_flIntervalPerTick;
            g_GlobalVars->m_iFrameCount = TIME_TO_TICKS( flSimulationTime );
            g_GlobalVars->m_iTickCount = TIME_TO_TICKS( flSimulationTime );
            g_GlobalVars->m_flInterpolationAmount = 0.0f;

            if ( pPlayer->GetAnimationState( )->m_iLastClientSideAnimationUpdateFramecount >= g_GlobalVars->m_iTickCount )
                pPlayer->GetAnimationState( )->m_iLastClientSideAnimationUpdateFramecount = g_GlobalVars->m_iFrameCount - 1;

            if ( bRotatePlayer )
            {
                float_t flEyeYaw = 0.0f;
                if ( iRotateSide < 0 )
                    flEyeYaw = m_LatestRecord.m_EyeAngles.yaw - 60.0f;
                else if ( iRotateSide > 0 )
                    flEyeYaw = m_LatestRecord.m_EyeAngles.yaw + 60.0f;
                else
                    flEyeYaw = m_LatestRecord.m_EyeAngles.yaw;
    
                pPlayer->GetAnimationState( )->m_flGoalFeetYaw = Math::NormalizeAngle( flEyeYaw );
            }

            if ( m_LatestRecord.m_DuckPerTick )
                pPlayer->m_flDuckAmount( ) += m_LatestRecord.m_DuckPerTick * iSimulationTick;
    
            for ( int i = 0; i < 13; i++ )
                pPlayer->GetAnimationLayers( )[ i ].m_pOwner = pPlayer;

            bool bClientSideAnimation = pPlayer->GetBaseAnimating( )->m_bClientSideAnimation( );
            g_Globals.m_AnimationData.m_bUpdateClientSideAnimation = pPlayer->GetBaseAnimating( )->m_bClientSideAnimation( ) = true;
            ( ( void( __thiscall* )( void* ) )( g_Globals.m_AddressList.UpdateClientSideAnimation ) )( pPlayer );
            g_Globals.m_AnimationData.m_bUpdateClientSideAnimation = false;
            pPlayer->GetBaseAnimating( )->m_bClientSideAnimation( ) = bClientSideAnimation;

            g_GlobalVars->m_flCurTime = flCurTime;
            g_GlobalVars->m_flRealTime = flRealTime;
            g_GlobalVars->m_flFrameTime = flFrameTime;
            g_GlobalVars->m_flAbsFrameTime = flAbsFrameTime;
            g_GlobalVars->m_iFrameCount = iFrameCount;
            g_GlobalVars->m_iTickCount = iTickCount;
            g_GlobalVars->m_flInterpolationAmount = flInterpolation;

            // increase simulation tick
            iSimulationTick++;
        }
        while ( iSimulationTick <= m_LatestRecord.m_ChokedTicks );
    }

Это ведь не то, как работает серверная анимация, тут не хватает апроуча и лерпа. Если вот так вот внаглую делать, то есть риск что анимка будет сломана и отличаться от серверной модельки, особенно при стрейфах, на лбу брикере и других моментах. Так же интерполяция duck вызывает немного вопросов.
 
Пользователь
Статус
Оффлайн
Регистрация
19 Янв 2019
Сообщения
348
Реакции[?]
99
Поинты[?]
6K
Аним фикс упд, просто аним фикс упд, но не пропер
 
Начинающий
Статус
Оффлайн
Регистрация
30 Июн 2021
Сообщения
5
Реакции[?]
0
Поинты[?]
0
Качественная паста от Porches, всем советую

p.s : там есть интересные моменты в коде, которые моментально бросаются в глаза...
 
Эксперт
Статус
Оффлайн
Регистрация
30 Дек 2019
Сообщения
1,967
Реакции[?]
958
Поинты[?]
19K
$$ Moneytalk comunity $$$​
Тема была создана по фану т.к половина югейма не знает даже как анимки обновить и наконец-то завести все таки этот ваш ресольвер вантапа...
Для особо одаренных профорсить m_flGoalFeetYaw = Yaw + 60 вам не достаточно, необходимо обовлять каждый чокнутый тик....


C++:
void C_AnimSync::UpdatePlayerAnimations( C_BasePlayer* pPlayer, C_LagRecord m_LatestRecord, C_LagRecord m_PreviousRecord, int32_t iRotateSide, bool bRotatePlayer )
{
    float_t flCurTime = g_GlobalVars->m_flCurTime;
    float_t flRealTime = g_GlobalVars->m_flRealTime;
    int32_t iFrameCount = g_GlobalVars->m_iFrameCount;
    int32_t iTickCount = g_GlobalVars->m_iTickCount;
    float_t flFrameTime = g_GlobalVars->m_flFrameTime;
    float_t flAbsFrameTime = g_GlobalVars->m_flAbsFrameTime;
    float_t flInterpolation = g_GlobalVars->m_flInterpolationAmount;

    float_t flDuckAmount = pPlayer->m_flDuckAmount( );
    int32_t iEFlags = pPlayer->m_iEFlags( );
    QAngle angEyeAngles = pPlayer->GetCSPlayer( )->m_angEyeAngles( );
    float_t flLowerBodyYaw = pPlayer->GetCSPlayer( )->m_flLowerBodyYaw( );

    float_t flFeetCycle = pPlayer->GetAnimationState( )->m_flFeetCycle;
    float_t flFeetWeight = pPlayer->GetAnimationState( )->m_flFeetWeight;

    pPlayer->m_iEFlags( ) &= ~EFL_DIRTY_ABSVELOCITY;
    pPlayer->m_fFlags( ) = m_LatestRecord.m_Flags;
    pPlayer->m_vecVelocity( ) = m_LatestRecord.m_Velocity;
    pPlayer->m_vecAbsVelocity( ) = m_LatestRecord.m_Velocity;

    pPlayer->SetAbsOrigin( m_LatestRecord.m_Origin );
    if ( g_PlayerData[ pPlayer->EntIndex( ) ].m_bHasPreviousRecord )
    {
        pPlayer->GetAnimationState( )->m_iStrafeSequence = m_PreviousRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_STRAFECHANGE ).m_nSequence;
        pPlayer->GetAnimationState( )->m_flStrafeCycle = m_PreviousRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_STRAFECHANGE ).m_flCycle;
        pPlayer->GetAnimationState( )->m_flStrafeWeight = m_PreviousRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_STRAFECHANGE ).m_flWeight;
        pPlayer->GetAnimationState( )->m_flFeetCycle = m_PreviousRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_MOVE ).m_flCycle;
        pPlayer->GetAnimationState( )->m_flFeetWeight = m_PreviousRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_MOVE ).m_flWeight;
        pPlayer->GetAnimationState( )->m_flLeanYaw = m_PreviousRecord.m_AnimationLayers.at( ANIMATION_LAYER_LEAN ).m_flWeight;

        std::memcpy( pPlayer->GetAnimationLayers( ), m_PreviousRecord.m_AnimationLayers.data( ), sizeof( C_AnimationLayer ) * 13 );
    }
    else
    {
        pPlayer->GetAnimationState( )->m_iStrafeSequence = m_LatestRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_STRAFECHANGE ).m_nSequence;
        pPlayer->GetAnimationState( )->m_flStrafeCycle = m_LatestRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_STRAFECHANGE ).m_flCycle;
        pPlayer->GetAnimationState( )->m_flStrafeWeight = m_LatestRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_STRAFECHANGE ).m_flWeight;
        pPlayer->GetAnimationState( )->m_flFeetCycle = m_LatestRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_MOVE ).m_flCycle;
        pPlayer->GetAnimationState( )->m_flFeetWeight = m_LatestRecord.m_AnimationLayers.at( ANIMATION_LAYER_MOVEMENT_MOVE ).m_flWeight;
        pPlayer->GetAnimationState( )->m_flLeanYaw = m_LatestRecord.m_AnimationLayers.at( ANIMATION_LAYER_LEAN ).m_flWeight;

        pPlayer->GetAnimationState( )->m_flLastClientSideAnimationUpdateTime = m_LatestRecord.m_SimulationTime - TICKS_TO_TIME( m_LatestRecord.m_ChokedTicks );
        if ( m_LatestRecord.m_Flags & FL_ONGROUND )
        {
            pPlayer->GetAnimationState( )->m_bOnGround = true;
            pPlayer->GetAnimationState( )->m_bInHitGroundAnimation = false;
        }

        pPlayer->GetAnimationState( )->m_flTotalTimeInAir = 0.0f;
    }

    if ( m_LatestRecord.m_ChokedTicks <= 1 )
    {
        g_GlobalVars->m_flCurTime = m_LatestRecord.m_SimulationTime;
        g_GlobalVars->m_flRealTime = m_LatestRecord.m_SimulationTime;
        g_GlobalVars->m_flFrameTime = g_GlobalVars->m_flIntervalPerTick;
        g_GlobalVars->m_flAbsFrameTime = g_GlobalVars->m_flIntervalPerTick;
        g_GlobalVars->m_iFrameCount = TIME_TO_TICKS( m_LatestRecord.m_SimulationTime );
        g_GlobalVars->m_iTickCount = TIME_TO_TICKS( m_LatestRecord.m_SimulationTime );
        g_GlobalVars->m_flInterpolationAmount = 0.0f;

        if ( pPlayer->GetAnimationState( )->m_iLastClientSideAnimationUpdateFramecount >= g_GlobalVars->m_iTickCount )
            pPlayer->GetAnimationState( )->m_iLastClientSideAnimationUpdateFramecount = g_GlobalVars->m_iFrameCount - 1;

        if ( bRotatePlayer )
        {
            float_t flEyeYaw = 0.0f;
            if ( iRotateSide < 0 )
                flEyeYaw = m_LatestRecord.m_EyeAngles.yaw - 60.0f;
            else if ( iRotateSide > 0 )
                flEyeYaw = m_LatestRecord.m_EyeAngles.yaw + 60.0f;
            else
                flEyeYaw = m_LatestRecord.m_EyeAngles.yaw;
   
            pPlayer->GetAnimationState( )->m_flGoalFeetYaw = Math::NormalizeAngle( flEyeYaw );
        }

        pPlayer->GetCSPlayer( )->m_angEyeAngles( ) = m_LatestRecord.m_EyeAngles;
        pPlayer->GetCSPlayer( )->m_flLowerBodyYaw( ) = m_LatestRecord.m_LowerBodyYaw;
        pPlayer->m_flDuckAmount( ) = m_LatestRecord.m_DuckAmount;

        for ( int i = 0; i < 13; i++ )
            pPlayer->GetAnimationLayers( )[ i ].m_pOwner = pPlayer;
   
        bool bClientSideAnimation = pPlayer->GetBaseAnimating( )->m_bClientSideAnimation( );
        g_Globals.m_AnimationData.m_bUpdateClientSideAnimation = pPlayer->GetBaseAnimating( )->m_bClientSideAnimation( ) = true;
        ( ( void( __thiscall* )( void* ) )( g_Globals.m_AddressList.UpdateClientSideAnimation ) )( pPlayer );
        g_Globals.m_AnimationData.m_bUpdateClientSideAnimation = false;
        pPlayer->GetBaseAnimating( )->m_bClientSideAnimation( ) = bClientSideAnimation;

        g_GlobalVars->m_flCurTime = flCurTime;
        g_GlobalVars->m_flRealTime = flRealTime;
        g_GlobalVars->m_flFrameTime = flFrameTime;
        g_GlobalVars->m_flAbsFrameTime = flAbsFrameTime;
        g_GlobalVars->m_iFrameCount = iFrameCount;
        g_GlobalVars->m_iTickCount = iTickCount;
        g_GlobalVars->m_flInterpolationAmount = flInterpolation;
    }
    else
    {
        int32_t iSimulationTick = 1;
        do
        {
            float_t flSimulationTime = pPlayer->m_flOldSimulationTime( ) + TICKS_TO_TIME( iSimulationTick );
            if ( g_PlayerData[ pPlayer->EntIndex( ) ].m_bHasPreviousRecord )
                flSimulationTime = g_PlayerData[ pPlayer->EntIndex( ) ].m_PreviousRecord.m_SimulationTime + TICKS_TO_TIME( iSimulationTick );

            g_GlobalVars->m_flCurTime = flSimulationTime;
            g_GlobalVars->m_flRealTime = flSimulationTime;
            g_GlobalVars->m_flFrameTime = g_GlobalVars->m_flIntervalPerTick;
            g_GlobalVars->m_flAbsFrameTime = g_GlobalVars->m_flIntervalPerTick;
            g_GlobalVars->m_iFrameCount = TIME_TO_TICKS( flSimulationTime );
            g_GlobalVars->m_iTickCount = TIME_TO_TICKS( flSimulationTime );
            g_GlobalVars->m_flInterpolationAmount = 0.0f;

            if ( pPlayer->GetAnimationState( )->m_iLastClientSideAnimationUpdateFramecount >= g_GlobalVars->m_iTickCount )
                pPlayer->GetAnimationState( )->m_iLastClientSideAnimationUpdateFramecount = g_GlobalVars->m_iFrameCount - 1;

            if ( bRotatePlayer )
            {
                float_t flEyeYaw = 0.0f;
                if ( iRotateSide < 0 )
                    flEyeYaw = m_LatestRecord.m_EyeAngles.yaw - 60.0f;
                else if ( iRotateSide > 0 )
                    flEyeYaw = m_LatestRecord.m_EyeAngles.yaw + 60.0f;
                else
                    flEyeYaw = m_LatestRecord.m_EyeAngles.yaw;
   
                pPlayer->GetAnimationState( )->m_flGoalFeetYaw = Math::NormalizeAngle( flEyeYaw );
            }

            if ( m_LatestRecord.m_DuckPerTick )
                pPlayer->m_flDuckAmount( ) += m_LatestRecord.m_DuckPerTick * iSimulationTick;
   
            for ( int i = 0; i < 13; i++ )
                pPlayer->GetAnimationLayers( )[ i ].m_pOwner = pPlayer;

            bool bClientSideAnimation = pPlayer->GetBaseAnimating( )->m_bClientSideAnimation( );
            g_Globals.m_AnimationData.m_bUpdateClientSideAnimation = pPlayer->GetBaseAnimating( )->m_bClientSideAnimation( ) = true;
            ( ( void( __thiscall* )( void* ) )( g_Globals.m_AddressList.UpdateClientSideAnimation ) )( pPlayer );
            g_Globals.m_AnimationData.m_bUpdateClientSideAnimation = false;
            pPlayer->GetBaseAnimating( )->m_bClientSideAnimation( ) = bClientSideAnimation;

            g_GlobalVars->m_flCurTime = flCurTime;
            g_GlobalVars->m_flRealTime = flRealTime;
            g_GlobalVars->m_flFrameTime = flFrameTime;
            g_GlobalVars->m_flAbsFrameTime = flAbsFrameTime;
            g_GlobalVars->m_iFrameCount = iFrameCount;
            g_GlobalVars->m_iTickCount = iTickCount;
            g_GlobalVars->m_flInterpolationAmount = flInterpolation;

            // increase simulation tick
            iSimulationTick++;
        }
        while ( iSimulationTick <= m_LatestRecord.m_ChokedTicks );
    }

    g_GlobalVars->m_flCurTime = flCurTime;
    g_GlobalVars->m_flRealTime = flRealTime;
    g_GlobalVars->m_flFrameTime = flFrameTime;
    g_GlobalVars->m_flAbsFrameTime = flAbsFrameTime;
    g_GlobalVars->m_iFrameCount = iFrameCount;
    g_GlobalVars->m_iTickCount = iTickCount;
    g_GlobalVars->m_flInterpolationAmount = flInterpolation;

    pPlayer->GetAnimationState( )->m_flFeetCycle = flFeetCycle;
    pPlayer->GetAnimationState( )->m_flFeetWeight = flFeetWeight;

    pPlayer->GetCSPlayer( )->m_angEyeAngles( ) = angEyeAngles;
    pPlayer->GetCSPlayer( )->m_flLowerBodyYaw( ) = flLowerBodyYaw;
    pPlayer->m_flDuckAmount( ) = flDuckAmount;
    pPlayer->m_iEFlags( ) = iEFlags;

    return pPlayer->InvalidatePhysicsRecursive( ANIMATION_CHANGED );
}


C-like:
UpdatePlayerAnimations( pRecord->m_pPlayer, pRecord, pPreviousRecord, 1, true);
// Ваше :
{
    std::memcpy( pRecord.ResolverLayers[1], pPlayer->GetAnimationLayers( ), sizeof( C_AnimationLayer ) * 13 );
}
INFO : Код порчеса внезапно отличается от кода актуального вантапа !!!!
Норм челики это заметили по одной вещи, а остальным соболезную
добавь вот ето ещё

Код:
void C_AnimSync::UpdateClientSideAnimations( C_BasePlayer* pPlayer )
{
    pPlayer->SetAbsOrigin( pPlayer->m_vecOrigin( ) );
 
    std::memcpy( pPlayer->m_CachedBoneData( ).Base( ), g_PlayerData[ pPlayer->EntIndex( ) ].m_aBoneArray.data( ), sizeof( matrix3x4_t ) * pPlayer->m_CachedBoneData( ).Count( ) );
    
    const auto aOldMatrix = pPlayer->GetBoneAccessor( ).GetBoneArrayForWrite( );
    pPlayer->GetBoneAccessor( ).m_aBoneArray = g_PlayerData[ pPlayer->EntIndex( ) ].m_aBoneArray.data( );
    pPlayer->SetupBones_AttachmentHelper( );
    pPlayer->GetBoneAccessor( ).m_aBoneArray = aOldMatrix;
}
и это
Код:
void C_AnimSync::Instance( ClientFrameStage_t Stage )
{
    if ( Stage != ClientFrameStage_t::FRAME_NET_UPDATE_END )
        return;
 
    int32_t iPlayerIndex = 0;
    do
    {
        iPlayerIndex++;
 
        C_BasePlayer* pPlayer = C_BasePlayer::GetPlayerByIndex( iPlayerIndex );
        if ( !pPlayer || !pPlayer->IsPlayer( ) || pPlayer->IsDormant( ) || !pPlayer->IsAlive( ) || pPlayer == g_Globals.m_Local || pPlayer->GetCSPlayer( )->m_bGunGameImmunity( ) || ( pPlayer->m_fFlags( ) & FL_FROZEN ) )
            continue;
 
        std::deque < C_LagRecord >& m_LagRecords = g_LagCompensation->GetPlayerRecords( iPlayerIndex );
        if ( m_LagRecords.empty( ) )
            continue;
        
        C_LagRecord& m_LatestRecord = m_LagRecords.back( );
        if ( pPlayer->m_flSimulationTime( ) <= pPlayer->m_flOldSimulationTime( ) )
            continue;
    
        C_LagRecord m_PreviousRecord = C_LagRecord( );
        if ( g_PlayerData[ iPlayerIndex ].m_bHasPreviousRecord )
        {
            m_PreviousRecord = g_PlayerData[ iPlayerIndex ].m_PreviousRecord;
            if ( m_PreviousRecord.m_AnimationLayers.at( ANIMATION_LAYER_ALIVELOOP ).m_flCycle == m_LatestRecord.m_AnimationLayers.at( ANIMATION_LAYER_ALIVELOOP ).m_flCycle )
                continue;
        }
 
        // save game shit
        std::array < float_t, 24 > aOldPoseParameters = { };
        std::array < C_AnimationLayer, ANIMATION_LAYER_COUNT > aOldAnimationLayers = { };
        C_CSGOPlayerAnimationState AnimationState_NULL = C_CSGOPlayerAnimationState( );
 
        std::memcpy( aOldAnimationLayers.data( ), m_LatestRecord.m_AnimationLayers.data( ), sizeof( C_AnimationLayer ) * ANIMATION_LAYER_COUNT );
        std::memcpy( aOldPoseParameters.data( ), m_LatestRecord.m_PoseParameters.data( ), sizeof( float_t ) * 24 );
 
        // rotate player and setup safe matricies
        for ( int32_t i = -1; i < 2; i++ )
        {
            this->UpdatePlayerAnimations( pPlayer, m_LatestRecord, m_PreviousRecord, i, true );
 
            // setup safe matrix
            g_BoneManager->BuildMatrix( pPlayer, m_LatestRecord.m_Matricies[ i + 2 ].data( ), true );
 
            // restore animation data
            std::memcpy( pPlayer->GetAnimationState( ), &AnimationState_NULL, sizeof( C_CSGOPlayerAnimationState ) );
            std::memcpy( pPlayer->GetAnimationLayers( ), aOldAnimationLayers.data( ), sizeof( C_AnimationLayer ) * ANIMATION_LAYER_COUNT );
            std::memcpy( pPlayer->GetBaseAnimating( )->m_aPoseParameters( ).data( ), aOldPoseParameters.data( ), sizeof( float_t ) * 24 );
        }
 
        // main anim update without player rotation cuz idont wanna give u guys my resolver
        this->UpdatePlayerAnimations( pPlayer, m_LatestRecord, m_PreviousRecord, 0, false );
        
        std::memcpy( pPlayer->GetAnimationLayers( ), m_LatestRecord.m_AnimationLayers.data( ), sizeof( C_AnimationLayer ) * ANIMATION_LAYER_COUNT );
        std::memcpy( m_LatestRecord.m_PoseParameters.data( ), pPlayer->GetBaseAnimating( )->m_aPoseParameters( ).data( ), sizeof( float_t ) * 24 );
        
        g_BoneManager->BuildMatrix( pPlayer, m_LatestRecord.m_Matricies[ 0 ].data( ), false );
        
        std::memcpy( pPlayer->m_CachedBoneData( ).Base( ), m_LatestRecord.m_Matricies[ 0 ].data( ), sizeof( matrix3x4_t ) * pPlayer->m_CachedBoneData( ).Count( ) );
        std::memcpy( g_PlayerData[ iPlayerIndex ].m_aBoneArray.data( ), pPlayer->m_CachedBoneData( ).Base( ), sizeof( matrix3x4_t ) * pPlayer->m_CachedBoneData( ).Count( ) );
    }
    while ( iPlayerIndex < 65 );
}
 
Сверху Снизу