// only on ground and if have m_vecVelocity.
if ( LagRecord->m_nFlags & SDK::Enums::Flags::FL_ONGROUND && LagRecord->m_nLayers[ SDK::Enums::AnimationLayers::ANIMATION_LAYER_MOVEMENT_MOVE ].m_flWeight > 0.0 && LagRecord->m_vecVelocity( ).Length( ) >= 0.1 )
{
// compare animation layer movement move flWeight.
if ( LagRecord->m_nLayers[ SDK::Enums::AnimationLayers::ANIMATION_LAYER_MOVEMENT_MOVE ].m_flWeight == PreviousLagRecord->m_nLayers[ SDK::Enums::AnimationLayers::ANIMATION_LAYER_MOVEMENT_MOVE ].m_flWeight )
{
// compare for animation layer movement move flWeight sucessfully done.
// now compare animation layer movement move nSequence.
if ( LagRecord->m_nLayers[ SDK::Enums::AnimationLayers::ANIMATION_LAYER_MOVEMENT_MOVE ].nSequence == PreviousLagRecord->m_nLayers[ SDK::Enums::AnimationLayers::ANIMATION_LAYER_MOVEMENT_MOVE ].nSequence )
{
// compare for animation layer movement move nSequence sucessfully done.
// now check for landing animation flWeight.
if ( LagRecord->m_nLayers[ SDK::Enums::AnimationLayers::ANIMATION_LAYER_MOVEMENT_LAND_OR_CLIMB ].m_flWeight == PreviousLagRecord->m_nLayers[ SDK::Enums::AnimationLayers::ANIMATION_LAYER_MOVEMENT_LAND_OR_CLIMB ].m_flWeight )
{
// compare for landing animation flWeight sucessfully done.
// get max speed.
auto flMaxSpeed = g_Globals->GetActiveWeapon ? std::max( 0.1f, g_Globals->GetActiveWeapon->GetMaxSpeed( ) ) : 260.0f;
// fuck my brain.
if ( flMaxSpeed >= 0.1f )
{
// get m_flSpeedAsPortionOfRunTopSpeed.
auto flSpeedAsPortionOfRunTopSpeed = 0.55f - ( LagRecord->m_nLayers[ SDK::Enums::AnimationLayers::ANIMATION_LAYER_MOVEMENT_MOVE ].m_flWeight - 1.0f ) / LagRecord->m_vecVelocity( ).Length( );
// check flWeight if not out of bounds.
if ( LagRecord->m_nLayers[ SDK::Enums::AnimationLayers::ANIMATION_LAYER_MOVEMENT_MOVE ].m_flWeight > 0.0 && LagRecord->m_nLayers[ SDK::Enums::AnimationLayers::ANIMATION_LAYER_MOVEMENT_MOVE ].m_flWeight < 1.0 )
{
// check flSpeedAsPortionOfRunTopSpeed values.
if ( flSpeedAsPortionOfRunTopSpeed > 0.1 && flSpeedAsPortionOfRunTopSpeed < 0.9 )
{
// set m_vecVelocity.
LagRecord->m_vecVelocity( ).x *= flSpeedAsPortionOfRunTopSpeed;
LagRecord->m_vecVelocity( ).y *= flSpeedAsPortionOfRunTopSpeed;
}
}
}
}
}
}
}