-
Автор темы
- #1
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
не судите строго просто фан ресик без говно кода
Код:
void c_resolver::resolve_yaw(player_t* player)
{
auto animstate = player->get_animation_state();
if (!animstate)
return;
AnimationLayer layers[13];
AnimationLayer moveLayers[3][13];
AnimationLayer preserver_anim_layers[13];
auto speed = player->m_vecVelocity().Length2D();
if (speed < 0.1f)
{
auto delta = std::remainder(math::normalize_yaw(player->m_angEyeAngles().y - player->m_flLowerBodyYawTarget()), 360.f) <= 0.f;
if (layers[3].m_flWeight == 0.0f
&& layers[3].m_flCycle == 0.0f)
{
m_Side = math::clamp((2 * (delta <= 0.f) - 1), -1, 1);
}
}
else if (!int(layers[12].m_flWeight * 1000.f))
{
if (int(layers[6].m_flWeight * 1000.f) == int(layers[6].m_flWeight * 1000.f))
{
float delta1 = abs(layers[6].m_flPlaybackRate - moveLayers[0][6].m_flPlaybackRate);
float delta2 = abs(layers[6].m_flPlaybackRate - moveLayers[1][6].m_flPlaybackRate);
float delta3 = abs(layers[6].m_flPlaybackRate - moveLayers[2][6].m_flPlaybackRate);
if (delta1 < delta3 || delta2 <= delta3 || (int)(float)(delta3 * 1000.0f)) {
if (delta1 >= delta2 && delta3 > delta2 && !(int)(float)(delta2 * 1000.0f))
{
m_Side = 1;
last_anims_update_time = m_globals()->m_realtime;
}
}
else
{
m_Side = -1;
last_anims_update_time = m_globals()->m_realtime;
}
}
}
if (m_Side = 1)
{
animstate->m_flGoalFeetYaw = math::normalize_yaw(player->m_angEyeAngles().y + 58.f);
}
else if (m_Side = -1)
{
animstate->m_flGoalFeetYaw = math::normalize_yaw(player->m_angEyeAngles().y - 58.f);
}
if (g_ctx.globals.missed_shots[player->EntIndex()] > 0)
{
switch (g_ctx.globals.missed_shots[player->EntIndex()] % 2)
{
case 0:
animstate->m_flGoalFeetYaw = math::normalize_yaw(player->m_angEyeAngles().y + 58.f);
break;
case 1:
animstate->m_flGoalFeetYaw = math::normalize_yaw(player->m_angEyeAngles().y - 58.f);
break;
}
}
}
resolver h;
class c_resolver
{
public:
void resolve_yaw(player_t* player);
int m_Side = 0;
float last_anims_update_time;
};
extern c_resolver* resolver;