-
Автор темы
- #1
C++:
static auto get_rotated_pos = [](Vector start, float rotation, float distance)
{
float rad = DEG2RAD(rotation);
start.x += cos(rad) * distance;
start.y += sin(rad) * distance;
return start;
};
int side = -1;
bool CurrentSideIsSafe = !util::visible(g_ctx.globals.eye_pos, player->hitbox_position_matrix(HITBOX_HEAD, player_record->matrixes_data.first), player, g_ctx.local());
c_baseplayeranimationstate* AnimState = player->get_animation_state();
float Vector2d = player->m_vecVelocity().Length2D();
bool AdjustmentBalance = player->m_nSequence() == 979 ? true : false;
Vector Angle = math::calculate_angle(g_ctx.globals.eye_pos, player->hitbox_position(HITBOX_HEAD));
Vector PosRight = get_rotated_pos(player->hitbox_position(HITBOX_HEAD), Angle.y, 60.f);
Vector PosLeft = get_rotated_pos(player->hitbox_position(HITBOX_HEAD), Angle.y, -60.f);
const auto WallRight = autowall::get().wall_penetration(g_ctx.globals.eye_pos, PosRight,g_ctx.local());
const auto WallLeft = autowall::get().wall_penetration(g_ctx.globals.eye_pos, PosLeft, g_ctx.local());
if (WallRight.valid && WallLeft.valid)
{
side = WallRight.damage > WallLeft.damage ? 1 : -1;
if (CurrentSideIsSafe)
{
side = WallRight.damage > WallLeft.damage ? -1 : 1;
}
}
float Delta = AdjustmentBalance ? 127 : player->get_max_desync_delta();
AnimState->m_flGoalFeetYaw += Delta * side;
player_record->side = side;