Начинающий
-
Автор темы
- #1
Код:
void c_resolver::instance(c_base_player* player, c_lag_record& lag_record, const c_lag_record previous_record)
{
if (!player || !player->is_alive())
return;
if (!player->get_anim_state())
return;
Vector velocity = player->get_anim_state()->m_velocity;
if (velocity.Length2D() > 1.2f)
{
lag_record.m_is_moving = true;
lag_record.m_is_standing = false;
Vector direction = velocity.Normalized();
float yaw = RAD2DEG(atan2(direction.y, direction.x));
lag_record.m_velocity_based_yaw = yaw;
resolve_moves(player, lag_record);
}
else
{
lag_record.m_is_moving = false;
lag_record.m_is_standing = true;
resolve_stand(player, lag_record);
}
/* if shot missed -> change current angle */
/* brute side filling in rage-bot if does intersect hitbox */
if (lag_record.m_rotation_mode == g_sdk.m_resolver_data.m_brute_side[player->ent_index()])
{
if (g_sdk.m_resolver_data.m_missed_shots[player->ent_index()] > 0)
{
auto new_rotation = ROTATE_SERVER;
/* fucking cycle xD */
switch (lag_record.m_rotation_mode)
{
case ROTATE_LEFT: new_rotation = ROTATE_RIGHT;
break;
case ROTATE_RIGHT: new_rotation = ROTATE_LOW_RIGHT;
break;
case ROTATE_LOW_RIGHT: new_rotation = ROTATE_LOW_LEFT;
break;
case ROTATE_LOW_LEFT: new_rotation = ROTATE_LEFT;
break;
default: break;
}
/* set new value */
lag_record.m_rotation_mode = new_rotation;
}
}
}