-
Автор темы
- #1
обнаружил что в Absend'e странный prepare targets, который не рандомом выберает таргетов, мб он неплох.
aim.cpp:
void aim::prepare_targets()
{
for (auto i = 1; i < m_globals()->m_maxclients; i++)
{
auto e = (player_t*)m_entitylist()->GetClientEntity(i);
if (!e->valid(true, false))
continue;
if (e->m_flSimulationTime() < e->m_flOldSimulationTime())
continue;
auto records = &player_records[i];
if (records->empty())
continue;
targets.emplace_back(target(e, get_record(records, false), get_record(records, true)));
}
if (targets.size() >= 4)
{
Vector engine_angles;
m_engine()->GetViewAngles(engine_angles);
for (auto i = 0; i < (targets.size() - 4); ++i)
{
auto worst_dist = -1.f;
int worst_player = -1;
for (auto i = 0; i < targets.size(); ++i)
{
auto fov = math::get_fov(engine_angles, math::calculate_angle(g_ctx.globals.eye_pos, targets.at(i).e->hitbox_position(HITBOX_CHEST)));
auto dist = targets.at(i).e->GetAbsOrigin().DistTo(g_ctx.local()->GetAbsOrigin());
if (dist > worst_dist && fov > 25.f)
{
worst_dist = dist;
worst_player = i;
}
}
if (worst_player != -1)
targets.erase(targets.begin() + i);
}
}
for (auto& target : targets)
backup.emplace_back(adjust_data(target.e));
}