const auto& layer = player->get_animlayers()[6];
float weight = layer.m_flWeight;
bool should_check_animations = [&]()
{
if (player->m_fFlags() & FL_ONGROUND)
return true;
return false;
}();
if (!should_check_animations)
{
old_side = freestanding_side;
triggered_animations = false;
}
else
{
static float old_rate = 0.f;
float rate_diff = abs(playback_rate - old_rate);
if (rate_diff > 0.00001f &&
rate_diff <= 0.0001f)
{
if (!triggered_animations)
{
old_side = -old_side;
triggered_animations = true;
}
}
else
triggered_animations = false;
old_rate = playback_rate;
}