kill me
-
Автор темы
- #1
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
это трэш, я не знаю будет ли это правильным)
Код:
// This is an independent project of an individual developer. Dear PVS-Studio, please check it.
// PVS-Studio Static Code Analyzer for C, C++, C#, and Java: http://www.viva64.com
#include "animation_system.h"
#include "..\ragebot\aim.h"
// ыхыъыъъы мне похуй это мой ресик и akiohide, он сказал сделать так.
void resolver::initialize(player_t* e, adjust_data* record, const float& goal_feet_yaw, const float& pitch)
{
player = e;
player_record = record;
original_goal_feet_yaw = math::normalize_yaw(goal_feet_yaw);
original_pitch = math::normalize_pitch(pitch);
}
void resolver::reset()
{
player = nullptr;
player_record = nullptr;
side = false;
fake = false;
was_first_bruteforce = false;
was_second_bruteforce = false;
original_goal_feet_yaw = 0.0f;
original_pitch = 0.0f;
}
void resolver::run()
{
//if (player->m_flSimulationTime() != player->m_flOldSimulationTime() && g_ctx.globals.check_aa_enable[player->EntIndex()]) //-V550
// check_aa();
if (g_ctx.globals.check_aa[player->EntIndex()])
{
// resolve_yaw = 0.0f;
resolve_yaw();
if (player->m_flSimulationTime() != player->m_flOldSimulationTime()) //-V550
lagcompensation::get().previous_goal_feet_yaw[player->EntIndex()] = math::normalize_yaw(player->m_angEyeAngles().y);
}
if (g_cfg.ragebot.pitch_correction)
pitch_resolve();
}
void resolver::StoreAntifreestand()
{
if (!g_ctx.local()->is_alive())
return;
if (!g_ctx.globals.weapon)
return;
for (int i = 1; i < m_globals()->m_maxclients; ++i)
{
auto get_player = m_entitylist()->GetClientEntity(i);
if (!player || !player->is_alive() || player->IsDormant() || player->m_iTeamNum() == g_ctx.local()->m_iTeamNum())
continue;
bool Autowalled = false, HitSide1 = false, HitSide2 = false;
auto idx = player->EntIndex();
float angToLocal = math::calculate_angle(g_ctx.local()->m_vecOrigin(), player->m_vecOrigin()).y;
Vector ViewPoint = g_ctx.local()->m_vecOrigin() + Vector(0, 0, 90);
Vector2D Side1 = { (45 * sin(DEG2RAD(angToLocal))),(45 * cos(DEG2RAD(angToLocal))) };
Vector2D Side2 = { (45 * sin(DEG2RAD(angToLocal + 180))) ,(45 * cos(DEG2RAD(angToLocal + 180))) };
Vector2D Side3 = { (50 * sin(DEG2RAD(angToLocal))),(50 * cos(DEG2RAD(angToLocal))) };
Vector2D Side4 = { (50 * sin(DEG2RAD(angToLocal + 180))) ,(50 * cos(DEG2RAD(angToLocal + 180))) };
Vector Origin = player->m_vecOrigin();
Vector2D OriginLeftRight[] = { Vector2D(Side1.x, Side1.y), Vector2D(Side2.x, Side2.y) };
Vector2D OriginLeftRightLocal[] = { Vector2D(Side3.x, Side3.y), Vector2D(Side4.x, Side4.y) };
for (int side = 0; side < 2; side++)
{
Vector OriginAutowall = { Origin.x + OriginLeftRight[side].x, Origin.y - OriginLeftRight[side].y , Origin.z + 90 };
Vector ViewPointAutowall = { ViewPoint.x + OriginLeftRightLocal[side].x, ViewPoint.y - OriginLeftRightLocal[side].y , ViewPoint.z };
if (autowall::get().CanHitFloatingPoint(OriginAutowall, ViewPoint))
{
if (side == 0)
{
HitSide1 = true;
FreestandSide[idx] = -1;
}
else if (side == 1)
{
HitSide2 = true;
FreestandSide[idx] = 1;
}
Autowalled = true;
}
else
{
for (int sidealternative = 0; sidealternative < 2; sidealternative++)
{
Vector ViewPointAutowallalternative = { Origin.x + OriginLeftRight[sidealternative].x, Origin.y - OriginLeftRight[sidealternative].y , Origin.z + 90 };
if (autowall::get().CanHitFloatingPoint(ViewPointAutowallalternative, ViewPointAutowall))
{
if (sidealternative == 0)
{
HitSide1 = true;
FreestandSide[idx] = -1;
}
else if (sidealternative == 1)
{
HitSide2 = true;
FreestandSide[idx] = 1;
}
Autowalled = true;
}
}
}
}
}
}
void resolver::resolve_yaw()
{
auto animstate = player->get_animation_state();
if (!animstate)
return;
int idx = player->EntIndex();
auto resolve_index = g_ctx.globals.missed_shots[player->EntIndex()] % 2;
bool forward = fabsf(math::normalize_yaw(player->m_angEyeAngles().y - math::normalize_yaw(math::calculate_angle
(g_ctx.local()->m_vecOrigin(), player->m_vecOrigin()).y - 180.f))) < 90.f;
auto current_side = RESOLVER_FIRST;
if (g_ctx.globals.history_data[player->EntIndex()].type_normal > 1)
current_side = RESOLVER_SECOND;
check_side(resolve_index);
if (g_ctx.globals.lby[player->EntIndex()] && g_ctx.globals.history_data[player->EntIndex()].type_low_delta)
{
if (g_ctx.globals.check_side[player->EntIndex()] == current_side)
{
switch (g_ctx.globals.missed_shots[player->EntIndex()] % 2)
{
case 0:
if (forward)
player_record->side == FreestandSide[idx] == 1 ? RESOLVER_SECOND : RESOLVER_FIRST;
else
player_record->side == FreestandSide[idx] == -1 ? RESOLVER_FIRST : RESOLVER_SECOND;
break;
case 1:
if (forward)
player_record->side == FreestandSide[idx] == -1 ? RESOLVER_FIRST : RESOLVER_SECOND;
else
player_record->side == FreestandSide[idx] == 1 ? RESOLVER_SECOND : RESOLVER_FIRST;
break;
}
}
}
auto weapon = player->m_hActiveWeapon().Get();
if (weapon && fabs(m_globals()->m_curtime - weapon->m_fLastShotTime()) <= TICKS_TO_TIME(1))
return;
}
void resolver::pitch_resolve()
{
if (!(player->m_fFlags() & FL_ONGROUND) && player->m_angEyeAngles().x >= 178.36304f)
pitch = -89.0f;
else
{
if (fabs(player->m_angEyeAngles().x) > 89.0f)
pitch = g_ctx.globals.fired_shots[player->EntIndex()] % 4 != 3 ? 89.0f : -89.0f;
else if (g_ctx.globals.fired_shots[player->EntIndex()] % 4 != 3)
pitch = 89.0f;
}
}
Для просмотра содержимого вам необходимо авторизоваться.