-
Автор темы
- #1
superior zeeron paste resolver reversed
C++:
if (!record->m_shooting || record->m_choked_ticks > 1 || has_previous_record)
{
if (player->get_velocity() <= 1.0f)
{
const auto eye_angles = player->get_eye_angles();
auto v73 = fmodf(eye_angles->y, 360.0f);
// angle normilize
auto srcAngle = v73;
if ( v73 > 180.0f )
{
v73 = v73 - 360.0f;
srcAngle = v73;
}
if ( v73 < -180.0f )
srcAngle = v73 + 360.0f;
// angle normilize
const auto lby = player->get_lby();
auto destAngle = fmodf(lby, 360.0f);
auto destAngle1 = destAngle;
if ( destAngle > 180.0f )
{
destAngle = destAngle - 360.0f;
destAngle1 = destAngle;
}
if ( destAngle < -180.0f )
{
destAngle = destAngle + 360.0f;
destAngle1 = destAngle;
}
// angle diff
const auto delta = fmodf(destAngle - srcAngle, 360.0f);
auto angle_1 = delta;
if ( destAngle1 <= srcAngle )
{
if ( delta <= -180.0f )
angle_1 = delta + 360.0f;
}
else if ( delta >= 180.0f )
{
angle_1 = delta - 360.0f;
}
// angle normilize
auto angle = fmodf(angle_1, 360.0f);
if ( angle > 180.0f )
angle = angle - 360.0f;
if ( angle < -180.0f )
angle = angle + 360.0f;
const auto final_side = 2 * (angle <= 0.0f) + 1;
record->m_side = final_side;
}
else
{
const auto play_back_rate = record->m_playback_rate;
const auto left_delta = fabs(record->m_left_playback_rate - play_back_rate);
const auto center_delta = fabs(record->m_center_playback_rate - play_back_rate);
const auto low_left_delta = fabs(record->m_low_left_playback_rate - play_back_rate);
const auto low_right_delta = fabs(record->m_low_right_playback_rate - play_back_rate);
const auto right_delta = fabs(record->m_right_playback_rate - play_back_rate);
auto last_delta = 0.0f;
if ( left_delta > center_delta )
record->m_side = 1; // rotate_left
if ( right_delta > 0.0f )
{
record->m_side = 3; // rotate_right
last_delta = right_delta;
}
if ( low_left_delta > last_delta )
{
record->m_side = 4; // rotate_low_left
last_delta = low_left_delta_1;
}
if ( low_right_delta > last_delta )
record->m_side = 5; // rotate_low_right
record->m_anim_resolved = true;
}
if ( record->m_side == g_sdk.m_resolver_data.m_last_brute_side && g_sdk.m_shot_data.m_missed_shots > 0 )
{
switch ( record->m_side )
{
case 1:
record->m_side = 3; break;
case 3:
record->m_side = 1; break;
case 4:
record->m_side = 5; break;
case 5:
record->m_side = 4; break;
}
}
}
Последнее редактирование: