-
Автор темы
- #1
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Код:
void aim::scan(adjust_data* record, scan_data& data, const Vector& shoot_position)
{
if (!g_ctx.globals.weapon)
return;
auto weapon_info = g_ctx.globals.weapon->get_csweapon_info();
if (!weapon_info)
return;
auto hitboxes = get_hitboxes(record);
if (hitboxes.empty())
return;
auto force_safe_points = key_binds::get().get_key_bind_state(3) || g_cfg.player_list.force_safe_points[record->i] || g_cfg.ragebot.weapon[g_ctx.globals.current_weapon].max_misses && g_ctx.globals.missed_shots[record->i] >= g_cfg.ragebot.weapon[g_ctx.globals.current_weapon].max_misses_amount;
auto best_damage = 0;
auto minimum_damage = get_minimum_damage(false, record->player->m_iHealth());
auto minimum_visible_damage = get_minimum_damage(true, record->player->m_iHealth());
auto get_hitgroup = [](const int& hitbox)
{
if (hitbox == HITBOX_HEAD)
return 0;
else if (hitbox == HITBOX_PELVIS)
return 1;
else if (hitbox == HITBOX_STOMACH)
return 2;
else if (hitbox >= HITBOX_LOWER_CHEST && hitbox <= HITBOX_UPPER_CHEST)
return 3;
else if (hitbox >= HITBOX_RIGHT_THIGH && hitbox <= HITBOX_LEFT_FOOT)
return 4;
else if (hitbox >= HITBOX_RIGHT_HAND && hitbox <= HITBOX_LEFT_FOREARM)
return 5;
return -1;
};
std::vector <scan_point> points;
for (auto& hitbox : hitboxes)
{
auto current_points = get_points(record, hitbox);
for (auto& point : current_points)
{
point.safe = record->bot || (hitbox_intersection(record->player, record->matrixes_data.zero, hitbox, shoot_position, point.point) && hitbox_intersection(record->player, record->matrixes_data.first, hitbox, shoot_position, point.point) && hitbox_intersection(record->player, record->matrixes_data.second, hitbox, shoot_position, point.point));
if (!force_safe_points || point.safe)
points.emplace_back(point);
}
}
if (points.empty())
return;
auto body_hitboxes = true;
for (auto& point : points)
{
if (body_hitboxes && (point.hitbox < HITBOX_PELVIS || point.hitbox > HITBOX_UPPER_CHEST))
{
body_hitboxes = false;
if (g_cfg.player_list.force_body_aim[record->i])
break;
if (key_binds::get().get_key_bind_state(22))
break;
if (g_cfg.ragebot.weapon[g_ctx.globals.current_weapon].prefer_body_aim && best_damage >= 1 && record->flags & FL_ONGROUND && !record->shot)
break;
}
auto fire_data = autowall::get().wall_penetration(shoot_position, point.point, record->player);
if (!fire_data.valid)
continue;
if (fire_data.damage < 1)
continue;
if (!fire_data.visible && !g_cfg.ragebot.autowall)
continue;
if (get_hitgroup(fire_data.hitbox) != get_hitgroup(point.hitbox))
continue;
auto current_minimum_damage = fire_data.visible ? minimum_visible_damage : minimum_damage;
if (fire_data.damage >= current_minimum_damage && fire_data.damage >= best_damage)
{
if (!should_stop)
{
should_stop = true;
if (g_cfg.ragebot.weapon[g_ctx.globals.current_weapon].autostop_modifiers[AUTOSTOP_LETHAL] && fire_data.damage < record->player->m_iHealth())
should_stop = false;
else if (g_cfg.ragebot.weapon[g_ctx.globals.current_weapon].autostop_modifiers[AUTOSTOP_VISIBLE] && !fire_data.visible)
should_stop = false;
else if (g_cfg.ragebot.weapon[g_ctx.globals.current_weapon].autostop_modifiers[AUTOSTOP_CENTER] && !point.center)
should_stop = false;
}
if (force_safe_points && !point.safe)
continue;
if (((record->flags & FL_ONGROUND && g_cfg.ragebot.weapon[g_ctx.globals.current_weapon].prefer_safe_points && point.safe) || (record->flags & FL_ONGROUND && point.hitbox >= HITBOX_PELVIS && point.hitbox <= HITBOX_UPPER_CHEST) || ((!(record->flags & FL_ONGROUND) || record->shot) && point.hitbox == HITBOX_HEAD)) && fire_data.damage >= record->player->m_iHealth())
{
best_damage = fire_data.damage;
data.point = point;
data.visible = fire_data.visible;
data.damage = fire_data.damage;
data.hitbox = fire_data.hitbox;
return;
}
else
{
best_damage = fire_data.damage;
data.point = point;
data.visible = fire_data.visible;
data.damage = fire_data.damage;
data.hitbox = fire_data.hitbox;
}
}
}
}