Superstar
-
Автор темы
- #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"
#include ".. \ misc \ misc.h"
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 :: resolve_yaw () {
#define enc_str (s) std :: string (s)
#define enc_char (s) enc_str (s) .c_str ()
#pragma region // Microwave //
#define PI 3.14159265358979323846f
#define DEG2RAD (x) ((float) (x) * (float) ((float) (PI) / 180.0f))
#define RAD2DEG (x) ((float) (x) * (float) (180.0f / (float) (PI)))
#define RADPI 57.295779513082f
#define rad (a) a * 0.01745329251
#define M_PI 3.14159265358979323846
if (player-> m_flowerBodyYawTarget ()> 180)
player-> m_flowerBodyYawTarget () - = (round (player-> m_flLowerBodyYawTarget () / 360) * 360.f);
else if (player-> m_flLowerBodyYawTarget () <-180)
player-> m_flLowerBodyYawTarget () + = (round (player-> m_flLowerBodyYawTarget () / 360) * -360.f);
return;
for (int w = 0; w <13; w ++)
{
AnimationLayer currentLayer = player-> get_animlayers () [1];
const int activity = player-> sequence_activity (currentLayer.m_nSequence);
float flcycle = currentLayer.m_flCycle, flprevcycle = currentLayer.m_flPrevCycle, flweight = currentLayer.m_flWeight, flweightdatarate = currentLayer.m_flWeightDeltaRate;
uint32_t norder = currentLayer.m_nOrder;
if (activity == ACT_CSGO_IDLE_ADJUST_STOPPEDMOVING)
return;
}
return;
float GetLBYRotatedYaw (float lby, float yaw); {
{
float delta = (player-> m_flLowerBodyYawTarget () - LBY);
if (fabs (delta) <25.f)
return;
if (delta> 0.f)
player-> m_flLowerBodyYawTarget () + 25.f;
return;
}
bool lowerBodyPrediction (player_t * pEntity);
{
static float prediction = 0.f;
static bool secondrun = false;
float flServerTime = (float) player-> m_nTickBase () * m_globals () -> m_intervalpertick;
if ((player) &&! secondrun)
{
prediction = flServerTime + 0.22;
secondrun = true;
}
else if (player-> m_vecVelocity (). Length2D () <0.1f && secondrun && prediction <= player-> m_flSimulationTime ())
{
prediction = player-> m_nTickBase () + 1.1f;
}
else // theyre moving
{
secondrun = false;
return;
}
if (prediction <= player-> m_flSimulationTime ())
{
return;
}
return;
}
float NormalizePitch (float pitch);
{
while (original_pitch> 89.f)
original_pitch - = 180.f;
while (original_pitch <-89.f)
original_pitch + = 180.f;
return;
}
float __fastcall ang_dif (float a1, float a2);
{
float val = fmodf (LBY - LBY, 360.0);
while (val <-180.0f) val + = 360.0f;
while (val> 180.0f) val - = 360.0f;
return;
}
bool adjusting_stop (player_t * player, AnimationLayer * layer);
{
for (int i = 0; i <15; i ++)
{
for (int s = 0; s <14; s ++)
{
auto anim_layer = player-> get_animlayers ();
if (! player-> get_animlayers () -> m_pOwner)
continue;
const int activity = player-> sequence_activity (player-> get_animlayers () -> m_nSequence);
if (activity == 981 && player-> get_animlayers () -> m_flWeight == 1.f)
{
return;
}
}
}
return;
} // ACT_CSGO_FIRE_PRIMARY
float get_average_lby_standing_update_delta (player_t * player); {
static float last_update_time [64];
static float second_laste_update_time [64];
static float oldlowerbody [64];
float lby = static_cast <int> (fabs (player-> m_angEyeAngles (). y - player-> m_flLowerBodyYawTarget ()));
if (lby! = oldlowerbody [player-> EntIndex ()]) {
second_laste_update_time [player-> EntIndex ()] = last_update_time [player-> EntIndex ()];
last_update_time [player-> EntIndex ()] = m_globals () -> m_curtime;
oldlowerbody [player-> EntIndex ()] = lby;
}
return;
}
float GetCurTime (CUserCmd * ucmd); {
player_t * local_player = g_ctx.local ();
static int g_tick = 0;
static CUserCmd * g_pLastCmd = nullptr;
if (! g_pLastCmd || g_pLastCmd-> m_predicted) {
g_tick = (float) local_player-> m_nTickBase ();
}
else {
// Required because prediction only runs on frames, not ticks
// So if your framerate goes below tickrate, m_nTickBase won't update every tick
++ g_tick;
}
float curtime = g_tick;
return;
}
Vector CalcAngle69 (Vector dst, Vector src);
{
Vector angles;
double delta [3] = {(player-> m_angEyeAngles (). x - player-> m_angEyeAngles (). x), (player-> m_angEyeAngles (). y - player-> m_angEyeAngles (). y), (player- > m_angEyeAngles (). z - player-> m_angEyeAngles (). z)};
double hyp = sqrt (delta [0] * delta [0] + delta [1] * delta [1]);
angles.x = (float) (atan (delta [2] / hyp) * 180.0 / 3.14159265);
angles.y = (float) (atanf (delta [1] / delta [0]) * 57.295779513082f);
angles.z = 0.0f;
if (delta [0]> = 0.0)
{
angles.y + = 180.0f;
}
return;
}
float lerp_time ();
{
int ud_rate = m_cvar () -> FindVar ("cl_updaterate") -> GetFloat ();
ConVar * min_ud_rate = m_cvar () -> FindVar ("sv_minupdaterate");
ConVar* max_ud_rate = m_cvar()->FindVar("sv_maxupdaterate");
if (min_ud_rate && max_ud_rate)
ud_rate = max_ud_rate->GetFloat();
float ratio = m_cvar()->FindVar("cl_interp_ratio")->GetFloat();
if (ratio == 0)
ratio = 1.0f;
float lerp = m_cvar()->FindVar("cl_interp")->GetFloat();
ConVar* c_min_ratio = m_cvar()->FindVar("sv_client_min_interp_ratio");
ConVar* c_max_ratio = m_cvar()->FindVar("sv_client_max_interp_ratio");
if (c_min_ratio && c_max_ratio && c_min_ratio->GetFloat() != 1)
ratio = math::clamp(ratio, c_min_ratio->GetFloat(), c_max_ratio->GetFloat());
return;
}
bool HasFakeHead (player_t * pEntity); {
// lby should update if distance from lby to eye angles exceeds 35 degrees
(player-> m_angEyeAngles (). y - player-> m_flLowerBodyYawTarget ())> 35;
}
bool Lbywithin35 (player_t * pEntity); {
// lby should update if distance from lby to eye angles less than 35 degrees
(player-> m_angEyeAngles (). y - player-> m_flLowerBodyYawTarget ()) <35;
}
bool IsMovingOnInAir (player_t * pEntity); {
// Check if player has a velocity greater than 0 (moving) and if they are onground.
(player-> m_fFlags () & FL_ONGROUND);
}
bool OnGround (player_t * pEntity); {
// Check if player has a velocity greater than 0 (moving) and if they are onground.
player-> m_fFlags () & FL_ONGROUND;
}
bool IsFakeWalking (player_t * pEntity); {
// Check if a player is moving, but at below a velocity of 36
player-> m_vecVelocity (). Length2D () <36.0f;
}
float tolerance = 10.f;
const inline float LBYDelta (player_t * v); {
player-> m_angEyeAngles (). y - player-> m_flLowerBodyYawTarget ();
}
const inline bool IsDifferent (float a, float b, float tolerance = 10.f); {
player-> get_max_desync_delta (), player-> m_flLowerBodyYawTarget ()> tolerance;
}
bool HasStaticYawDifference (const std :: deque <player_t *> & l, float tolerance);
}
int GetDifferentDeltas (const std :: deque <player_t *> & l, float tolerance); {
}
int GetDifferentLBYs (const std :: deque <player_t *> & l, float tolerance); {
}
bool DeltaKeepsChanging (const std :: deque <player_t *> & cur, float tolerance); {
}
bool LBYKeepsChanging (const std :: deque <player_t *> & cur, float tolerance); {
}
void LowerBodyYawFix (Vector * & Angle, player_t * Player);
{
if (player-> m_vecVelocity (). Length ()> 1 && (player-> m_fFlags () & FL_ONGROUND))
player-> m_angEyeAngles (). y = player-> m_flLowerBodyYawTarget ();
}
bool IsNearEqual (float v1, float v2, float Tolerance);
{
(player-> m_angEyeAngles (). y - player-> m_flowerBodyYawTarget ());
}
int GetSequenceActivity (player_t * pEntity, int sequence);
{
const model_t * pModel = player-> GetModel ();
if (! pModel)
return;
auto hdr = (player-> GetModel ());
if (! hdr)
return;
(player, hdr, player-> m_nSequence ());
}
int playersequence_activity ();
{
auto hdr = player-> GetModel ();
if (! hdr)
return;
return;
}
bool lby_keeps_updating (); {
player-> m_flLowerBodyYawTarget ();
}
bool IsAdjustingBalance (player_t * player, AnimationLayer * layer);
{
for (int i = 0; i <15; i ++)
{
const int activity = player-> sequence_activity (player-> m_nSequence ());
if (activity == 979)
{
return;
}
}
return;
}
bool adjusting_balance (player_t * e, AnimationLayer * set); {
const auto activity = player-> sequence_activity (player-> m_nSequence ());
if (activity == 979) {
return;
}
return;
}
float NormalizeFloatToAngle (float input);
{
for (auto i = 0; i <3; i ++) {
while (player-> m_flLowerBodyYawTarget () <-180.0f) player-> m_flLowerBodyYawTarget () + = 360.0f;
while (player->m_flLowerBodyYawTarget() > 180.0f) player->m_flLowerBodyYawTarget() -= 360.0f;
}
return ;
}
float FixAusnahmeAngles(float yaw, float desyncdelta);
{
for (auto i = 0; i < 3; i++) {
while (player->get_animation_state()->m_flCurrentFeetYaw< -player->get_max_desync_delta()) player->get_animation_state()->m_flCurrentFeetYaw < +player->get_max_desync_delta();
while (player->get_animation_state()->m_flCurrentFeetYaw < -player->get_max_desync_delta()) player->get_animation_state()->m_flCurrentFeetYaw < -player->get_max_desync_delta();
}
return ;
}
#define M_PI 3.14159265358979323846
void LBYBreakerCorrections(player_t* pEntity);
{
float movinglby[64];
float lbytomovinglbydelta[64];
bool onground = player-> m_fFlags () & FL_ONGROUND;
if (g_cfg.antiaim.lby_type)
{
lbytomovinglbydelta [player-> EntIndex ()] = player-> m_flLowerBodyYawTarget () - lbytomovinglbydelta [player-> EntIndex ()];
if (player-> m_vecVelocity (). Length2D ()> 6 && player-> m_vecVelocity (). Length2D () <42)
{
player-> m_angEyeAngles (). y = player-> m_flowerBodyYawTarget () + 120;
}
else if (player-> m_vecVelocity (). Length2D () <6 || player-> m_vecVelocity (). Length2D ()> 42) // they are moving
{
player-> m_angEyeAngles (). y = player-> m_flLowerBodyYawTarget ();
movinglby [player-> EntIndex ()] = player-> m_flLowerBodyYawTarget ();
}
else if (lbytomovinglbydelta [player-> EntIndex ()]> 50 && lbytomovinglbydelta [player-> EntIndex ()] <-50 &&
lbytomovinglbydelta [player-> EntIndex ()] <112 && lbytomovinglbydelta [player-> EntIndex ()] <-112) // the 50 will allow you to have a 30 degree margin of error (do the math :))
{
player-> m_angEyeAngles (). y = movinglby [player-> EntIndex ()];
}
else player-> m_angEyeAngles (). y = player-> m_flLowerBodyYawTarget ();
}
}
void VectorAnglesBruteGay (const Vector & forward, Vector & angles);
{
float tmp, yaw, pitch;
if (player-> GetBody ())
{
yaw = 0;
if (player-> get_animlayers () -> m_flWeight> 0) pitch = 270; else pitch = 90;
}
else
{
yaw = (player-> get_animlayers () -> m_flWeight> 0 * 180 / M_PI);
if (yaw <0) yaw + = 360; tmp = sqrt (player-> get_animlayers () -> m_flWeight> 0); pitch = (atan2 (-player-> get_animlayers () -> m_flWeight, tmp) * 180 / M_PI);
if (pitch <0) pitch + = 360;
} pitch;
}
Vector calc_angle_trash (Vector src, Vector dst);
{
Vector ret;
VectorAnglesBruteGay;
return;
}
float flLen = player-> m_vecVelocity (). Length ();
if (flLen == 0) {
player-> m_vecVelocity (). init (0, 0, 1);
return;
}
flLen = 1 / flLen;
player-> m_vecVelocity (). Init (player-> m_vecVelocity (). x * flLen, player-> m_vecVelocity (). y * flLen, player-> m_vecVelocity (). z * flLen);
const float MaxDegrees = 180.0f;
Vector Angles = player-> m_vecViewOffset (), Origin = player-> m_vecViewOffset ();
Vector Delta (0, 0, 0), Forward (0, 0, 0);
Vector AimPos;
(Angles, & Forward);
VectorSubtract (AimPos, Origin, Delta);
(Delta, Delta);
float DotProduct = Forward.Dot (Delta);
return;
int index = -1;
float lowest_fov = 180.f; // maybe ??
player_t * local_player = player;
if (! local_player)
return;
if (! local_player-> is_alive ())
return;
Vector local_position = local_player-> GetAbsOrigin () + local_player-> m_vecViewOffset ();
Vector angles;
m_engine () -> GetViewAngles (angles);
for (int i = 1; i <= m_globals () -> m_maxclients; i ++)
{
auto entity = static_cast <player_t *> (m_entitylist () -> GetClientEntity (i));
if (!entity || entity->m_iHealth() <= 0 || entity->m_iTeamNum() == local_player->m_iTeamNum() || entity->IsDormant() || entity == local_player)
continue;
float fov = (local_position, angles, entity, 0);
if (fov < lowest_fov)
{
lowest_fov = fov;
index = i;
}
}
return ;
#define MASK_SHOT_BRUSHONLY (CONTENTS_SOLID|CONTENTS_MOVEABLE|CONTENTS_WINDOW|CONTENTS_DEBRIS)
float apply_freestanding(player_t* enemy);
{
auto local_player = player;
if (!(player->m_iHealth() > 0))
return ;
bool no_active = true;
float bestrotation = 0.f;
float highestthickness = 0.f;
static float hold = 0.f;
Vector besthead;
auto leyepos = player->m_vecOrigin() + player->m_vecViewOffset();
auto headpos = player->hitbox_position(0);
auto origin = player->m_vecOrigin();
int index = player->EntIndex();
if (index == -1)
return ;
if (player->EntIndex())
{
auto checkWallThickness = [&](player_t* pPlayer, Vector newhead) -> float
{
Vector endpos1, endpos2;
Vector eyepos = local_player->m_vecOrigin() + local_player->m_vecViewOffset();
Ray_t ray;
CTraceFilterSkipTwoEntities filter(local_player, player);
trace_t trace1, trace2;
ray.Init(newhead, eyepos);
m_trace()->TraceRay(ray, MASK_SHOT_BRUSHONLY, &filter, &trace1);
if (trace1.DidHit())
{
endpos1 = trace1.endpos;
float add = newhead.DistTo(eyepos) - leyepos.DistTo(eyepos) + 75.f;
return endpos1.DistTo(eyepos) + add / 2; // endpos2
}
else
{
endpos1 = trace1.endpos;
float add = newhead.DistTo(eyepos) - leyepos.DistTo(eyepos) - 75.f;
return endpos1.DistTo(eyepos) + add / 2; // endpos2
}
};
float radius = Vector(headpos - origin).Length2D();
for (float besthead = 0; besthead < 7; besthead += 0.1)
{
Vector newhead(radius * cos(besthead) + leyepos.x, radius * sin(besthead) + leyepos.y, leyepos.z);
float totalthickness = 0.f;
no_active = false;
totalthickness += checkWallThickness(player, newhead);
if (totalthickness > highestthickness)
{
highestthickness = totalthickness;
bestrotation = besthead;
}
}
return;
}
}
bool predict_lby (player_t * player, float oldlby [64], float lby, float speed);
{
static bool nextflick [64];
static float add_time [64];
const auto sim = player-> m_flSimulationTime ();
if (! g_cfg.antiaim.lby_type)
return;
for (auto i = 0; i <m_globals () -> m_maxclients; ++ i)
{
if (LBY)
{
add_time [i] = m_globals () -> m_intervalpertick + 1.1f;
}
if (player-> m_flFallVelocity ()> = 0.1f)
{
add_time [i] = 0.22f;
nextflick [i] = sim + add_time [i];
}
if (sim> = nextflick [i] && player-> m_flFallVelocity () <= 0.1f)
{
add_time [i] = 1.1f;
nextflick [i] = sim + add_time [i];
return;
}
}
return;
}
bool UTILS;
{
float GetCurtime ();
{
if (! m_engine () -> IsConnected () ||! m_engine () -> IsInGame ())
return;
if (! player)
return;
player-> m_nTickBase ();
}
float GetLBYRotatedYaw (float lby, float yaw);
{
float delta = math :: normalize_yaw (LBY);
if (fabs (delta) <25.f)
return;
if (delta> 0.f)
return;
return;
}
}
bool MATH;
{
float flAngleMod (float flAngle);
{
return;
}
void VectorAngles (const Vector & forward, Vector & angles);
{
float tmp, yaw, pitch;
if (player-> get_animlayers () -> m_flWeight == 0 && player-> get_animlayers () -> m_flWeight == 0)
{
yaw = 0;
if (player->get_animlayers()->m_flWeight > 0)
pitch = 270;
else
pitch = 90;
}
else
{
yaw = (atan2(player->get_animlayers()->m_flWeight, player->get_animlayers()->m_flWeight) * 180 / M_PI);
if (yaw < 0)
yaw += 360;
tmp = sqrt(player->get_animlayers()->m_flWeight * player->get_animlayers()->m_flWeight + player->get_animlayers()->m_flWeight * player->get_animlayers()->m_flWeight);
pitch = (atan2(-player->get_animlayers()->m_flWeight, tmp) * 180 / M_PI);
if (pitch < 0)
pitch += 360;
}
player->get_animlayers()->m_flWeight = pitch;
player-> get_animlayers () -> m_flWeight = yaw;
player-> get_animlayers () -> m_flWeight = 0;
}
void inline SinCos (float radians, float * sine, float * cosine);
{
return;
}
float GRD_TO_BOG (float GRD); {
(PI / 180);
}
void AngleVectors (const Vector & angles, Vector * forward, Vector * right, Vector * up);
{
float sr, sp, sy, cr, cp, cy;
if (player-> m_angEyeAngles (). y)
{
player-> m_angEyeAngles (). x = cp * cy;
player-> m_angEyeAngles (). y = cp * sy;
player-> m_angEyeAngles (). z = -sp;
}
if (player-> m_angEyeAngles (). y)
{
player-> m_angEyeAngles (). x = (-1 * sr * sp * cy + -1 * cr * -sy);
player-> m_angEyeAngles (). y = (-1 * sr * sp * sy + -1 * cr * cy);
player-> m_angEyeAngles (). z = -1 * sr * cp;
}
if (player-> m_angEyeAngles (). z)
{
player-> m_angEyeAngles (). x = (cr * sp * cy + -sr * -sy);
player-> m_angEyeAngles (). y = (cr * sp * sy + -sr * cy);
player-> m_angEyeAngles (). z = cr * cp;
}
}
__forceinline float DotProduct (const float * a, const float * b);
{
player-> m_angEyeAngles (). y * player-> m_angEyeAngles (). x + player-> m_angEyeAngles (). z * player-> m_angEyeAngles (). x + player-> m_angEyeAngles (). y * player-> m_angEyeAngles ( ) .z;
}
__forceinline float DotProduct (const Vector & a, const Vector & b);
{
player-> m_angEyeAngles (). x * player-> m_angEyeAngles (). x + player-> m_angEyeAngles (). y * player-> m_angEyeAngles () y + player-> m_angEyeAngles (). z * player-> m_angEyeAngles ( ) .z;
}
void VectorTransform (const float * in1, const matrix3x4_t & in2, float * out);
{
return;
}
void VectorTransform (const Vector & in1, const matrix3x4_t & in2, Vector & out);
{
}
void VectorTransforma (const Vector & in1, const matrix3x4_t & in2, Vector & out);
{
}
float CalcAngle2D (const Vector2D & src, const Vector2D & dst);
{
float angle;
(player-> m_angEyeAngles (). y - player-> m_angEyeAngles (). x, angle);
return;
}
void VectorAngle2D (const Vector2D & direction, float & angle);
{
float angle = (std :: atan2 (player-> m_angEyeAngles (). y, player-> m_angEyeAngles (). x)) + 90.f;
}
void AngleVectors2D (float angle, Vector2D & forward);
{
}
}
#pragma endregion
float ResolverOvermake;
{
resolver resolver;
resolver :: resolve_pitch ();
bool fsn (ClientFrameStage_t stage);
{
if (player)
return;
auto local_player = player;
if (! local_player || local_player-> m_iHealth () <= 0)
return;
static bool wasDormant [65];
for (int i = 0; i <m_globals () -> m_maxclients; i ++)
{
auto e = static_cast <player_t *> (m_entitylist () -> GetClientEntity (i));
auto entity = static_cast <player_t *> (m_entitylist () -> GetClientEntity (i));
if (! entity || entity-> m_iHealth () <= 0 || entity-> m_iTeamNum () == local_player-> m_iTeamNum () ||! entity-> is_alive ())
continue;
player_info_t player_info;
m_engine () -> GetPlayerInfo (entity-> EntIndex (), & player_info);
if (player_info.fakeplayer)
return;
if (FRAME_RENDER_START && RESOLVER_SECOND == 3)
{
if (entity-> IsDormant ())
{
continue;
}
(entity);
}
if (FRAME_RENDER_START && RESOLVER_SECOND == 2)
{
if (entity-> IsDormant ())
{
continue;
}
(entity, e);
}
if (FRAME_RENDER_START && RESOLVER_SECOND == 1)
{
if (entity-> IsDormant ())
{
continue;
}
}
if (FRAME_NET_UPDATE_END && entity! = player && RESOLVER_SECOND == 1)
{
if (entity-> IsDormant ())
{
continue;
}
auto VarMap = reinterpret_cast <uintptr_t> (entity) + 36;
auto VarMapSize = * reinterpret_cast <int *> (VarMap + 20);
for (auto index = 0; index <VarMapSize; index ++)
* reinterpret_cast <uintptr_t *> (* reinterpret_cast <uintptr_t *> (VarMap) + index * 12) = 0;
}
if (FRAME_NET_UPDATE_POSTDATAUPDATE_START) {
player-> m_angEyeAngles ();
(entity);
/// make sure to do dormant check AFTER calling UpdateResolveRecord ()
if (entity-> IsDormant ())
continue;
if (RESOLVER_SECOND == 0)
{
math :: normalize_yaw (resolver :: side);
}
}
wasDormant [i] = false;
}
}
bool skeetres0lver (IClientEntity * entity, player_t * e);
{
auto anim_state = player-> get_animation_state (); // get state
static float v42, v56, v49,
v51, v46;
if (anim_state-> m_fDuckAmount> 0.0)
{
auto v29 = 0.0;
if (anim_state-> m_flFeetSpeedUnknownForwardOrSideways <0.0)
v29 = 0.0;
float v52 = anim_state-> m_fDuckAmount * v51;
v49 = v49 + (float) (v52 * (float) (0.5 - v49));
}
float v47 = (float) ((anim_state-> m_flStopToFullRunningFraction * -0.30000001f) - 0.19999999f) * v46;
v49 = v47 + 1.0;
switch (g_ctx.globals.missed_shots [player-> EntIndex ()]% 4)
{
case 0:
anim_state-> m_flGoalFeetYaw + = 59.0f; // yaw
break;
case 1:
anim_state-> m_flGoalFeetYaw - = 59.0f; // yaw
break;
case 2:
anim_state-> m_flGoalFeetYaw - = 89.0f; // yaw
break;
case 3:
anim_state-> m_flGoalFeetYaw + = 89.0f; // yaw
break;
case 4:
anim_state-> m_flGoalFeetYaw - = anim_state-> m_flGoalFeetYaw? -180: 180; // yaw 360 - 180
break;
case 5:
anim_state-> m_flGoalFeetYaw + = anim_state-> m_flGoalFeetYaw? -180: 180; // yaw 360 - 180
break;
case 6:
anim_state-> m_flGoalFeetYaw - = anim_state-> m_flGoalFeetYaw? -58: 58; // desync
break;
default:
break;
}
float speed;
if (* (float *) (anim_state + 0xF8) <0.f)
{
speed = 0.0;
}
else
{
speed = fminf (* (DWORD *) (anim_state + 0xF8), 1.0f);
}
player_t * e = nullptr;
float lby_delta = e-> m_flLowerBodyYawTarget ();
lby_delta = std :: remainderf (lby_delta, 360.f);
lby_delta = math :: clamp (lby_delta, -60.f, 60.f);
float v73 = std :: remainderf (lby_delta, 360.f);
if (v73 <0.f) {
v73 + = 360.f;
}
static int v36;
if (anim_state)
{
if (g_ctx.globals.missed_shots [e-> EntIndex ()] <= 2) {
if (v36> 180.0)
v36 = v36 - 360.0;
if (v36 < 180.0)
v36 = v36 + 360.0;
anim_state->m_flGoalFeetYaw = v36;
}
}
float v25 = math::clamp(anim_state->m_fDuckAmount + anim_state->m_fLandingDuckAdditiveSomething, 0.0f, 1.0f);
float v26 = anim_state->m_fDuckAmount;
float v27 = 6.0f;
float v28;
if ((v25 - v26) <= v27) { // clamp
if (-v27 <= (v25 - v26))
v28 = v25;
else
v28 = v26 - v27;
}
else {
v28 = v26 + v27;
}
}
bool onetap_dump(player_t * entity);
{
typedef unsigned long LODWORD;
auto local_player = static_cast <player_t *> (m_entitylist () -> GetClientEntity (m_engine () -> GetLocalPlayer ()));
auto v3 = local_player;
if (v3! = player)
{
auto animstate = player-> get_animation_state ();
if (animstate)
{
if (animstate-> m_fDuckAmount> 0.0)
{
auto v29 = 0.0;
if (animstate-> m_flFeetSpeedUnknownForwardOrSideways <0.0)
v29 = 0.0;
else
v29 = std :: fminf (LODWORD (animstate-> m_flFeetSpeedUnknownForwardOrSideways), 0x3F800000);
}
if (g_ctx.globals.missed_shots [player-> EntIndex ()] <= 2)
{
float speed;
if (* (float *) (animstate + 0xF8) <0.f)
{
speed = 0.0;
}
else
{
speed = fminf (* (DWORD *) (animstate + 0xF8), 1.0f);
}
float flYawModifier = (* (float *) (animstate + 0x11C) * -0.30000001 - 0.19999999) * speed;
flYawModifier + = 1.0f;
if (* (float *) (animstate + 0xA4)> 0.0 && * (float *) (animstate + 0xFC)> = 0.0)
flYawModifier = fminf (* (float *) (uintptr_t (animstate) + 0xFC), 1.0f);
float m_flMaxBodyYaw = * (float *) (uintptr_t (animstate) + 0x334) * flYawModifier;
float m_flMinBodyYaw = * (float *) (uintptr_t (animstate) + 0x330) * flYawModifier;
float ResolvedYaw = animstate-> m_flEyeYaw;
float delta = std :: abs (animstate-> m_flEyeYaw - animstate-> m_flGoalFeetYaw);
if (m_flMaxBodyYaw <delta)
{
ResolvedYaw = animstate-> m_flEyeYaw - std :: abs (m_flMaxBodyYaw);
}
else if (m_flMinBodyYaw> delta)
{
ResolvedYaw = animstate-> m_flEyeYaw + std :: abs (m_flMinBodyYaw);
}
animstate-> m_flGoalFeetYaw = math :: normalize_yaw (ResolvedYaw);
}
else
{
switch (g_ctx.globals.missed_shots [player-> EntIndex ()]% 4)
{
case 0:
animstate-> m_flGoalFeetYaw + = 59.0f;
break;
case 1:
animstate-> m_flGoalFeetYaw - = 59.0f;
break;
case 2:
animstate-> m_flGoalFeetYaw - = 78.0f;
break;
case 3:
animstate-> m_flGoalFeetYaw + = 78.0f;
break;
case 4:
animstate-> m_flGoalFeetYaw - = animstate-> m_flGoalFeetYaw? -180: 180;
break;
case 5:
animstate-> m_flGoalFeetYaw + = animstate-> m_flGoalFeetYaw? -180: 180;
break;
default:
break;
}
}
}
/ * else
{
switch (g_ctx.m_globals.missed_shots[entity->EntIndex()] % 3)
{
case 0:
entity->m_angEyeAngles -= animstate->m_flGoalFeetYaw ? -58 : 58;
break;
case 1:
entity->m_angEyeAngles += animstate->m_flGoalFeetYaw ? -58 : 58;
break;
case 2:
entity->m_angEyeAngles -= animstate->m_flGoalFeetYaw ? -89 : 89;
break;
case 3:
entity->m_angEyeAngles += animstate->m_flGoalFeetYaw ? -89 : 89;
break;
case 4:
entity->m_angEyeAngles -= animstate->m_flGoalFeetYaw ? -78 : 78;
break;
case 5:
entity-> m_angEyeAngles + = animstate-> m_flGoalFeetYaw? -78: 78;
break;
default:
break;
}
} * /
}
}
bool desync_resolver (player_t * entity);
{
for (int i = 0; i <= m_globals () -> m_maxclients; i ++) {
if (! player) continue;
if (! player-> is_alive ())
continue;
if (player-> IsDormant ())
continue;
if (player-> m_angEyeAngles (). y? 58: -58);
}
}
bool HandleHits (player_t * pEnt);
{
auto NetChannel = m_engine () -> GetNetChannelInfo ();
if (! NetChannel)
return;
static float predTime [65];
static bool init [65];
int fired = g_ctx.globals.missed_shots [player-> EntIndex ()];
int missed = g_ctx.globals.missed_shots [player-> EntIndex ()];
if (g_ctx.globals.fired_shots [player-> EntIndex ()])
{
if (init [player-> EntIndex ()])
{
predTime [player-> EntIndex ()] = m_globals () -> m_curtime + NetChannel-> GetAvgLatency (FLOW_INCOMING) + NetChannel-> GetAvgLatency (FLOW_OUTGOING) + TICKS_TO_TIME (1), (m_engineChonnfo) );
init [player-> EntIndex ()] = false;
}
if (m_globals () -> m_curtime> predTime [player-> EntIndex ()] &&! g_ctx.globals.fired_shots [player-> EntIndex ()])
{
g_ctx.globals.missed_shots [player-> EntIndex ()] + = 1;
g_ctx.globals.fired_shots [player-> EntIndex ()] = false;
}
else if (m_globals () -> m_curtime <= predTime [player-> EntIndex ()] && g_ctx.globals.fired_shots [player-> EntIndex ()])
g_ctx.globals.fired_shots [player-> EntIndex ()] = false;
}
else
init [player-> EntIndex ()] = true;
g_ctx.globals.fired_shots [player-> EntIndex ()] = false;
}
bool is_slow_walking (player_t * entity); {
if ((player))
return;
float large = 0;
float velocity_2D [64], old_velocity_2D [64];
if (player-> m_vecVelocity (). Length2D ()! = velocity_2D [player-> EntIndex ()] && player-> m_vecVelocity (). Length2D ()! = NULL) {
old_velocity_2D [player-> EntIndex ()] = velocity_2D [player-> EntIndex ()];
velocity_2D[player->EntIndex()] = player->m_vecVelocity().Length2D();
}
if (large == 0)return;
Vector velocity = player->m_vecVelocity();
Vector direction = player->m_angEyeAngles();
float speed = velocity.Length();
direction.y = player->m_angEyeAngles().y - direction.y;
//method 1
if (velocity_2D[player->EntIndex()] > 1) {
int tick_counter[64];
if (velocity_2D[player->EntIndex()] == old_velocity_2D[player->EntIndex()])
tick_counter[player->EntIndex()] += 1;
else
tick_counter[player->EntIndex()] = 0;
while (tick_counter [player-> EntIndex ()]> (1 / m_globals () -> m_intervalpertick) * fabsf (0.1f)) // should give use 100ms in ticks if their speed stays the same for that long they are definetely up to something ..
return;
}
// method 2
// removed
// method 3 / resource heavy but does most of the work
// removed
// method 4
// method 5
if (speed <3 && velocity.Length2D ()! = 0) // same here
return;
return;
}
bool high_delta (player_t * player, AnimationLayer * layer);
{
for (int s = 0; s <14; s ++)
{
AnimationLayer record [15];
auto anim_layer = player-> get_animlayers () [s];
auto anime = & player-> get_animlayers () [1];
if (! anim_layer.m_pOwner)
continue;
for (auto i = 0; i <m_globals () -> m_maxclients; ++ i)
{
auto activity = player-> sequence_activity (player-> get_animlayers () -> m_nSequence);
if ((anim_layer.m_flPrevCycle! = anim_layer.m_flCycle || anim_layer.m_flWeight == 1.f) && activity == 979)
{
return;
}
}
}
return;
}
bool low_delta (player_t * player, AnimationLayer * layer);
{
for (int s = 0; s <14; s ++)
{
auto anim_layer = player-> get_animlayers ();
auto anime = & player-> get_animlayers () [1];
if (! player-> get_animlayers () -> m_pOwner)
continue;
for (auto i = 0; i <m_globals () -> m_maxclients; ++ i)
{
auto activity = player-> sequence_activity (player-> get_animlayers () -> m_nSequence);
if (player-> get_animlayers () -> m_flPrevCycle> 0.92f && player-> get_animlayers () -> m_flCycle> 0.92f && player-> get_animlayers () -> m_flWeight == 0.f)
{
return;
}
}
}
return;
}
bool is_fakewalk (player_t * player, float speed, AnimationLayer * layer);
{
if (player-> m_iHealth () <= 0)
return;
if (player-> IsDormant ())
return;
for (int s = 0; s <14; s ++)
{
auto activity = player-> sequence_activity (player-> get_animlayers () -> m_nSequence);
if (player-> get_animation_state () -> m_flSpeedNormalized> 0.1f && player-> get_animlayers () -> m_flWeight! = 0.f && activity == 979)
{
return;
}
}
return;
}
bool IsYawSideways (player_t * entity, float yaw);
{
auto local_player = player;
if (! local_player)
return;
const auto at_target_yaw = math :: calculate_angle (local_player-> m_vecOrigin (), player-> m_vecOrigin ()). y;
const float delta = fabs (math :: normalize_yaw (at_target_yaw));
return;
}
bool desync_fix (player_t * e); {
auto local_player = static_cast <player_t *> (m_entitylist () -> GetClientEntity (m_engine () -> GetLocalPlayer ())); if (! local_player) return;
for (int i = 0; i <= m_globals () -> m_maxclients; i ++) {
auto entity = static_cast <player_t *> (m_entitylist () -> GetClientEntity (i)); if (! entity) continue;
if (! entity-> is_alive ())
continue;
if (entity-> IsDormant ())
continue;
if (player-> m_angEyeAngles (). y? 58: -58)
return;
}
return;
}
bool desyncfixv2 (player_t * entity); {
float flSimulationTime = player-> m_flSimulationTime ();
float flSimDiff = m_globals () -> m_curtime - flSimulationTime;
return;
}
bool Update (player_t * pEnt); {
}
bool resolved_desync (bool * send_packets, CUserCmd * cmd); {
if (! send) {
player-> m_angEyeAngles (). y + = 180.f;
}
else {
player-> m_angEyeAngles (). y + = 180.f + player-> get_max_desync_delta ();
}
if (player-> m_fFlags ()) {
static bool switch_ = false;
if (switch_)
2;
else
2;
switch_ =! switch_;
}
}
bool ausnahme = false;
bool wwwwimibagpulainmataro (player_t * entity);
{
// removed
if (player-> get_animlayers () -> m_flPlaybackRate == 0) // experiment
{
player-> m_angEyeAngles (). y;
}
}
bool ResolveYawBruteforce (player_t * entity);
{
int fired = g_ctx.globals.fired_shots [player-> EntIndex ()];
int missed = g_ctx.globals.missed_shots [player-> EntIndex ()];
auto & resolve_record = g_ctx.globals.revolver_working;
auto best = [] (float primary, float secondary, float defined, bool accurate) -> float
{
if (accurate)
{
if (math :: angle_distance (math :: normalize_yaw (primary), math :: normalize_yaw (defined)) <= 50)
return math :: normalize_yaw (primary);
else if (math :: angle_distance (math :: normalize_yaw (secondary), math :: normalize_yaw (defined)) <= 50)
return math :: normalize_yaw (secondary);
else
return math :: normalize_yaw (defined);
}
else
{
if (math :: angle_distance (math :: normalize_yaw (primary), math :: normalize_yaw (defined)) <= 80)
return math :: normalize_yaw (primary);
else if (math :: angle_distance (math :: normalize_yaw (secondary), math :: normalize_yaw (defined)) <= 80)
return math :: normalize_yaw (secondary);
else
return math :: normalize_yaw (defined);
}
};
bool antiresolver (bool * send_packets, CUserCmd * cmd);
(Delta);
{
if (player-> get_max_desync_delta ())
g_cfg.ragebot.autoshoot = true;
}
(Delta);
{
if (player-> get_max_desync_delta () && ((Delta)) <= 0)
g_cfg.ragebot.autoshoot = true;
player-> get_animation_state () -> m_flUpdateTimeDelta;
(Delta);
g_cfg.ragebot.autoshoot = false;
}
float v3;
float v4;
float v5 = v4;
float v6 = v4;
float v7 = (v4 + 896);
DWORDLONG (v138) = v5;
float v1;
float v9 = (v5 + 880);
float v10 = (v5 + 892);
float v11 = v9;
float v12 = (v11 + 8) - 1;
float v13 = v7 == 2;
float v14 = (v11 + 4);
float v15 = (v14 + 4);
float v18 = v6 + 9920;
(player-> m_vecVelocity (). z * player-> m_vecVelocity (). z) +
((player-> m_vecVelocity (). y * player-> m_vecVelocity (). y) + (player-> m_vecVelocity (). x * player-> m_vecVelocity (). x));
if (player-> m_vecVelocity (). Length2D ()); 0.1 || player-> m_vecVelocity (). Length2D (); 0.1;
v18 = v6 + 9940;
if (player-> get_animlayers () -> m_flWeight + 14.25092419f> 0.54 || player-> m_bHasDefuser ())
{
if (player-> get_animlayers () -> m_flCycle> 0.12)
{
if (player-> get_animlayers () -> m_flCycle> 0.43)
{
float yawresolver = player-> m_angEyeAngles (). y; // no fake angles
return;
}
player-> m_hActiveWeapon () -> can_double_tap ();
ResolveYawBruteforce;
}
}
float desync_delta (player_t * entity); {
auto animstate = player-> get_animation_state ();
float duckamount = animstate-> m_fDuckAmount; // + 0xA4;
float speedfraction = (0, (animstate-> m_flFeetSpeedForwardsOrSideWays, 1));
float speedfactor = (0, (animstate-> m_flFeetSpeedForwardsOrSideWays, 1));
float unk1 = ((* reinterpret_cast <float *> ((uintptr_t) animstate + 0x11C) * -0.30000001) - 0.19999999) * speedfraction;
float unk2 = unk1 + 1.f;
if (duckamount> 0.0)
unk2 + = ((duckamount * speedfactor) * (0.5f - unk2));
return;
}
float sub_59B13C30 (player_t * entity);
{
if (player) {
float v1; // xmm0_4
float v2; // xmm1_4
float v3; // xmm0_4
int v4; // eax
float v5; // xmm4_4
float v6; // xmm2_4
float v7; // xmm0_4
int v8; // eax
float v10; // [esp + 0h] [ebp-Ch]
float v11; // [esp + 4h] [ebp-8h]
v1 = player-> get_animation_state () -> m_flFeetSpeedForwardsOrSideWays;
v2 = 1.0;
v10 = 0.0;
v11 = v1;
if (v1 <= 1.f)
{
v4 = v10;
if (v1> = 0.0)
v4 = v11;
v3 = v4;
}
else
v3 = 1.f;
v5 = player-> m_flDuckAmount ();
v6 = ((player-> get_animation_state () -> m_flStopToFullRunningFraction * -0.30000001f) - 0.19999999f) * v3 + 1.0f;
if (v5> 0.0)
{
v7 = player-> get_animation_state () -> m_flFeetSpeedForwardsOrSideWays;
v11 = 0.0;
v10 = v7;
if (v7 <= 1.0)
{
v8 = v11;
if (v7> = 0.0)
v8 = v10;
v2 = v8;
}
v6 = v6 + (float) ((float) (v2 * v5) * (float) (0.5f - v6));
}
return;
}
else
return; // ((* (float *) ((uintptr_t) nn + 0x334)) * v6);
}
bool compare_delta (float v1, float v2, float Tolerance);
{
float v1 = math :: normalize_yaw (v1);
float v2 = math :: normalize_yaw (v2);
if (fabs (math :: normalize_yaw (v1)) <= ToleranceHigh)
return;
return;
}
std :: unordered_map <int, float> old_static_yaw = {};
std :: unordered_map <int, int> prev_rotation = {};
bool data_arrive (bool * send_packets, CUserCmd * cmd);
{
auto history = g_ctx.globals.missed_shots [player-> EntIndex () - 1];
if (fabs (player-> get_animlayers () -> m_flCycle - player-> get_animlayers () -> m_flCycle)> 0.000f)
player-> get_animlayers () -> m_flCycle = m_globals () -> m_realtime;
auto pitch = player-> m_angEyeAngles (). x;
if (pitch == 88.9947510f) // fix netvar compression
player-> m_angEyeAngles (). x = 89.f;
player-> m_angEyeAngles (). x = math :: clamp (pitch, -89.f, 89.f);
auto current_velocity_angle = (atan2 (player-> m_vecVelocity (). y, player-> m_vecVelocity (). x));
auto balance_adjust = (player-> get_animlayers () -> m_flWeight> 0.01f && player-> sequence_activity (player-> get_animlayers () -> m_nSequence) == 979 && player-> get_animlayers () -> m_flCycle <1.f) ;
auto activity = player-> sequence_activity (player-> get_animlayers () -> m_nSequence);
if (balance_adjust)
m_globals () -> m_realtime;
float resolve_datadid_shot_this_tick = (player-> m_hActiveWeapon () -> m_fLastShotTime () = nullptr && player-> m_hActiveWeapon () -> m_fLastShotTime () && (player-> m_angEyeAngles fabs (). x x) <65)); // ((activity> = ACT_CSGO_FIRE_PRIMARY && activity <= ACT_CSGO_FIRE_SECONDARY_OPT_2) && resolve_data-> server_anim_layers [1] .m_flWeight> = 0.01f && m_player-> get_animation_mlayer) | (m_player-> get_weapon () && m_player-> get_weapon () -> m_Activity () == 208);
float resolve_datatick_delta = math :: normalize_yaw (player-> m_angEyeAngles (). y);
float resolve_dataabs_yaw_delta = math :: normalize_yaw (player-> m_angEyeAngles (). y);
float resolve_datalby_delta = math :: normalize_yaw (player-> m_flLowerBodyYawTarget () - player-> m_angEyeAngles (). y);
float resolve_datais_jittering = (/ * fabs (resolve_data-> tick_delta)> 90 && * / fabs (m_globals () -> m_realtime) <1.f && (fabs (m_globals () -> m_realtime) <0.6f) && fabs (m_globals () -> m_realtime) <2.f);
float resolve_datalast_velocity_angle = current_velocity_angle;
float resolve_datalast_speed = player-> m_vecVelocity (). Length ();
float resolve_datalast_lby = player-> m_flLowerBodyYawTarget ();
if (resolve_datalast_speed> 0.1f)
float resolve_datalast_speed = m_globals () -> m_realtime;
if (TIME_TO_TICKS (player-> m_flSimulationTime () - player-> m_flOldSimulationTime ())> 1)
float resolve_datalast_speed = m_globals () -> m_realtime;
if (fabs (resolve_datais_jittering - player-> get_animlayers () -> m_flPlaybackRate) == 0.003f)
float resolve_datalast_speed = m_globals () -> m_realtime;
if (resolve_dataabs_yaw_delta! = resolve_dataabs_yaw_delta)
{
if (resolve_dataabs_yaw_delta! = 0.0f)
resolve_datalby_delta = m_globals () -> m_realtime;
if (resolve_dataabs_yaw_delta> resolve_datatick_delta)
resolve_datalby_delta = m_globals () -> m_realtime;
resolve_dataabs_yaw_delta! = resolve_dataabs_yaw_delta;
}
float resolve_datais_using_static = ((fabs (resolve_datalby_delta - m_globals () -> m_realtime) <1.f || fabs (resolve_datalast_speed - m_globals () -> m_realtime)> 1.f && resolve_datalast_speed & fast & resolve_datalast_speed! (fabs (m_globals () -> m_realtime - resolve_datais_jittering) <0.6f)); / * (fabs (lag_data-> last_time_moved - lag_data-> last_move_cycle_update)> 0.1f && lagpGs (Source) -> last_feet_cycle_update) <0.25f) || * / // (fabs (resolve_data-> m_flClientRate - resolve_data-> m_flRate)> 0.00020f && resolve_data-> m_flClientRate == 0.f));
float resolve_datais_using_balance = (fabs (m_globals () -> m_realtime - resolve_datalby_delta) <0.6f && fabs (resolve_datalby_delta)> 0.0001f);
float resolve_datadid_lby_update_fail = (fabs (resolve_dataabs_yaw_delta)> 0.0001f && fabs (resolve_datalby_delta)> 0.0001f);
if ((player-> m_flPoseParameter (), 0.5f) * 116.f);
if (resolve_datais_using_balance)
resolve_datalast_lby = resolve_datais_using_balance = (fabs (m_globals () -> m_realtime - resolve_datalby_delta) <0.1f && history% 2 == 1); // (fabs (Source :: m_pGlobalVars-> realtime - resolve_data-> last_time & bal fabs (resolve_data-> lby_delta)> 0.0000f);
if (resolve_datais_using_balance)
resolve_datalast_lby = resolve_datalast_lby;
if (! resolve_datais_using_balance)
resolve_datalast_lby = (fabs (resolve_datalast_lby)> 45.f && (history> 0 && history% 3 <2));
}
}
if (player-> get_animlayers ());
auto cur_layer = player-> get_animlayers ();
auto cnumber = 0;
while (player-> get_animlayers () -> m_nOrder)
{
++ cnumber;
if (cnumber> = 13)
return;
}
return;
}
float resolver :: resolve_pitch () {
return original_pitch;
}
[/ CODE]