ЧВК EB_LAN
-
Автор темы
- #1
Здраствуйте, решил слить вам свой антифристенд ресольвер.
UPD: Я не отрицаю что сверху основной анти-фристенд парт не мой а с вива.
UPD2: Почему вам смешно? Вполне адекватный код, я знаю что там есть пару мемов впринципе, но это так надо.)
Код:
void resolver::AntiFreestand(adjust_data* record)
{
bool Autowalled = false, HitSide1 = false, HitSide2 = false;
auto idx = player->EntIndex();
float angToLocal = M::calculate_angle(csgo.local()->m_vecOrigin(), player->m_vecOrigin()).y;
Vector ViewPoint = csgo.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().wall_penetration(OriginAutowall, ViewPoint, player).visible)
{
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().wall_penetration(ViewPointAutowallalternative, ViewPointAutowall, player).visible)
{
if (sidealternative == 0)
{
HitSide1 = true;
FreestandSide[idx] = 1;
}
else if (sidealternative == 1)
{
HitSide2 = true;
FreestandSide[idx] = -1;
}
Autowalled = true;
}
}
}
}
}
void resolver::resolve_yaw()
{
if (vars.ragebot.enable)
{
//--Shit-Code--\\
auto animstate = player->get_animation_state();
float m_abs_yaw = animstate->m_flGoalFeetYaw;
float lby = player->EyeAngles().y;
float delta = M::angle_diff(lby, m_abs_yaw);
auto idx = player->EntIndex();
auto missed_shots = csgo.globals.missed_shots[idx];
const bool& sideways = fabsf(M::fix_yaw(lby - GetLeftYaw(player))) < 45.f || fabsf(M::fix_yaw(lby - GetRightYaw(player))) < 45.f;
const bool& forward = fabsf(M::fix_yaw(lby - GetForwardYaw(player))) < 90.f && !sideways;
//--Shit-Code--\\
//--Anti-Freestand-resolver--\\
if (missed_shots == 0)
{
m_abs_yaw = M::fix_yaw(lby - desync_delta * (forward ? -FreestandSide[idx] : FreestandSide[idx]));
}
else
{
if (forward)
{
switch (missed_shots % 2)
{
case 0:
if (FreestandSide[idx] == 1)
m_abs_yaw = M::fix_yaw(lby - desync_delta); else m_abs_yaw = M::fix_yaw(lby + desync_delta); break;
case 1:
if (FreestandSide[idx] == -1)
m_abs_yaw = M::fix_yaw(lby + desync_delta); else m_abs_yaw = M::fix_yaw(lby - desync_delta); break;
default: break;
}
}
else
{
switch (missed_shots % 2)
{
case 0:
if (FreestandSide[idx] == -1)
m_abs_yaw = M::fix_yaw(lby + desync_delta); else m_abs_yaw = M::fix_yaw(lby - desync_delta); break;
case 1:
if (FreestandSide[idx] == 1)
m_abs_yaw = M::fix_yaw(lby - desync_delta); else m_abs_yaw = M::fix_yaw(lby + desync_delta); break;
default: break;
}
}
}
//--Anti-Freestand-resolver--\\
}
}
UPD2: Почему вам смешно? Вполне адекватный код, я знаю что там есть пару мемов впринципе, но это так надо.)
Последнее редактирование: