-
Автор темы
- #1
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
C++:
#include "../includes.h"
Resolver g_resolver{ };;
int Resolver::GetChokedPackets(Player* entity)
{
auto ticks = game::TIME_TO_TICKS(entity->m_flSimulationTime() - entity->m_flOldSimulationTime());
if (ticks == 0 && last_ticks[entity->index()] > 0)
{
return last_ticks[entity->index()] - 1;
}
else
{
last_ticks[entity->index()] = ticks;
return ticks;
}
}
void Resolver::ResolveAngles(Player* player, LagComp::LagRecord_t* record) {
AimPlayer* data = &g_aimbot.m_players[player->index() - 1];
if (game::IsFakePlayer(record->m_iEntIndex))
return;
if (!record->m_bDidShot)
{
if (g_cfg[XOR("cheat_mode")].get<int>() == 1)
{
switch (data->m_missed_shots % 2)
{
case 0:
record->m_angEyeAngles.x = player->m_angEyeAngles().x = -90.f;
case 1:
record->m_angEyeAngles.x = player->m_angEyeAngles().x = +90.f;
break;
}
}
}
resolver(data, record);
}
bool Resolver::IsLBYdesync(LagComp::LagRecord_t* record) {
if (GetChokedPackets(record->m_pEntity) >= 1 && record->m_pEntity->m_vecVelocity().length_2d() <= 0.15)
return true;
else
return false;
}
float AngleDiff(float destAngle, float srcAngle) {
float delta;
delta = fmodf(destAngle - srcAngle, 360.0f);
if (destAngle > srcAngle) {
if (delta >= 180)
delta -= 360;
}
else {
if (delta <= -180)
delta += 360;
}
return delta;
}
void Resolver::resolver(AimPlayer* data, LagComp::LagRecord_t* record)
{
float max_rotation = record->m_pEntity->GetMaxBodyRotation();
float resolve_value = 60.f;
if (!record->m_pState)
return;
const auto info = g_anims.GetAnimationInfo(record->m_pEntity);
if (!info)
return;
float m_flEyeYaw = record->m_pState->m_flEyeYaw;
float m_flGoalFeetYaw = record->m_pState->m_flGoalFeetYaw;
data->m_extending = record->m_pLayers[3].m_cycle == 0.f && record->m_pLayers[3].m_weight == 0.f;
float m_flSide = AngleDiff(m_flEyeYaw, m_flGoalFeetYaw) > 0.f ? -60.f : 60.f; // aka side
if (record->m_pEntity->GetSequenceActivity(record->m_pLayers[6].m_sequence) == 979)
record->m_pState->m_flGoalFeetYaw = record->m_pState->m_flEyeYaw; // maby
if (max_rotation < resolve_value)
resolve_value = max_rotation;
if (IsLBYdesync(record))
{
info->m_flBrute = record->m_pEntity->m_flLowerBodyYawTarget();
IsLbyDesync = true; // for log
}
else
IsLbyDesync = false;
if (record->m_bDidShot)
info->m_flBrute = Resolver::ResolveShot(data, record);
if (data->m_extending)
{
BrutSide = 0; // for log
if (m_flSide < 0.f)
{
info->m_flBrute = 22.f;
}
else
{
info->m_flBrute = -19.f;
}
}
else {
float lbyt = record->m_pEntity->m_flLowerBodyYawTarget();
data->m_delta = std::abs(math::NormalizedAngle(m_flEyeYaw - lbyt));
float resolve_yaw = ((data->m_delta < 0.f) ? resolve_value : resolve_value);
switch (data->m_missed_shots % 3) {
case 0:
info->m_flBrute = data->m_last_resolve = resolve_yaw;
BrutSide = 1; // for log
break;
case 1:
info->m_flBrute = -data->m_last_resolve;
BrutSide = 2; // for log
break;
case 2:
info->m_flBrute = 0;
BrutSide = 3; // for log
break;
}
}
for (; m_flGoalFeetYaw > 180.0; m_flGoalFeetYaw = m_flGoalFeetYaw - 360.0); //normalize
for (; m_flGoalFeetYaw < -180.0; m_flGoalFeetYaw = m_flGoalFeetYaw + 360.0); //normalize
record->m_pState->m_flGoalFeetYaw = m_flEyeYaw + info->m_flBrute;
}
float Resolver::ResolveShot(AimPlayer* data, LagComp::LagRecord_t* record)
{
player_info_t info;
float flPseudoFireYaw = math::NormalizedAngle(math::CalcAngle(record->m_pMatrix[8].GetOrigin(), g_cl.m_local->m_BoneCache().m_pCachedBones[0].GetOrigin()).y);
std::string name{ std::string(info.m_name).substr(0, 24) };
if (data->m_extending)
{
float flLeftFireYawDelta = fabsf(math::NormalizedAngle(flPseudoFireYaw - (record->m_angEyeAngles.y + 60.f)));
float flRightFireYawDelta = fabsf(math::NormalizedAngle(flPseudoFireYaw - (record->m_angEyeAngles.y - 60.f)));
return flLeftFireYawDelta > flRightFireYawDelta ? 180.f : -253.f;
}
else
{
float flLeftFireYawDelta = fabsf(math::NormalizedAngle(flPseudoFireYaw - (record->m_angEyeAngles.y + 30.f)));
float flRightFireYawDelta = fabsf(math::NormalizedAngle(flPseudoFireYaw - (record->m_angEyeAngles.y - 30.f)));
return flLeftFireYawDelta > flRightFireYawDelta ? -360.f : 30.f;
}
}
resolver.h
C++:
#pragma once
class ShotRecord;
class Resolver {
public:
int sideS[65];
int sideJ;
bool IsLbyDesync;
bool HasJitter;
int ds;
int BrutSide;
int last_ticks[65];
int GetChokedPackets(Player* entity);
void ResolveAngles(Player* player, LagComp::LagRecord_t* record);
bool IsLBYdesync(LagComp::LagRecord_t* record);
float ResolveShot(AimPlayer* data, LagComp::LagRecord_t* record);
void resolver(AimPlayer* data, LagComp::LagRecord_t* record);
public:
std::array< vec3_t, 64 > m_impacts;
};
extern Resolver g_resolver;