get good get legendware
-
Автор темы
- #1
its a pretty shit resolver dont blame me i just converted it to weave nothing special
in resolver.cpp
[LIKES = 3]
#include "Hooks.h"
#include "Resolver.h"
#include "RageBacktracking.h"
#include "Ragebot.h"
#include "AnimationFix.h"
void c_resolver :: resolve2 (animation * record, IBasePlayer * local)
{
float resolver_yaw = 0.f;
// is it neither a bot nor a legit player?
if (! record-> player || record-> player-> GetPlayerInfo (). fakeplayer)
{
resolver.missed_due_to_bad_resolve [record-> index] = 0;
return;
}
const auto animstate = record-> anim_state;
if (! record-> has_anim_state)
return;
const auto missed_shots = resolver.missed_due_to_bad_resolve [record-> index];
auto logic_resolver_1 = [&] () // rifk7 resolver with changes
{
const auto local1 = local-> GetPlayerAnimState ();
if (! local1)
return 0.f;
auto resolver_yaw = 0.f;
auto freestanding_yaw = 0.f;
const auto current_shot = missed_shots% 2;
float max_desync_angle = 29.f;
const auto plus_desync = record-> eye_angles.y + max_desync_angle;
const auto minus_desync = record-> eye_angles.y - max_desync_angle;
// StoreAntifreestand (local, & freestanding_yaw);
const auto diff_from_plus_desync = fabs (Math :: AngleDiff (freestanding_yaw, plus_desync));
const auto diff_from_minus_desync = fabs (Math :: AngleDiff (freestanding_yaw, minus_desync));
const auto first_yaw = diff_from_plus_desync <diff_from_minus_desync? plus_desync: minus_desync;
const auto second_yaw = diff_from_plus_desync <diff_from_minus_desync? minus_desync: plus_desync;
// const auto third_yaw = Math :: CalculateAngle (local-> get_shoot_position (), record-> player-> get_shoot_position ()). y;
switch (current_shot)
{
case 0:
resolver_yaw = first_yaw;
break;
case 1:
resolver_yaw = second_yaw;
break;
// case 2:
// resolver_yaw = third_yaw;
// break;
default:
break;
}
return resolver_yaw;
};
resolver_yaw = logic_resolver_1 ();
// logging-> info (_ ("resolver delta =% f \ n", resolver_yaw));
record-> anim_state-> m_goal_feet_yaw = Math :: normalize_yaw (resolver_yaw);
const auto current_animstate = record-> player-> GetPlayerAnimState ();
if (current_animstate)
current_animstate-> m_goal_feet_yaw = record-> anim_state-> m_goal_feet_yaw;
} [/ LIKES]
in the resolver.hpp
[LIKES = 3]
#include "Hooks.h"
#include "Resolver.h"
#include "RageBacktracking.h"
#include "Ragebot.h"
#include "AnimationFix.h"
void c_resolver :: resolve2 (animation * record, IBasePlayer * local)
{
float resolver_yaw = 0.f;
// is it neither a bot nor a legit player?
if (! record-> player || record-> player-> GetPlayerInfo (). fakeplayer)
{
resolver.missed_due_to_bad_resolve [record-> index] = 0;
return;
}
const auto animstate = record-> anim_state;
if (! record-> has_anim_state)
return;
const auto missed_shots = resolver.missed_due_to_bad_resolve [record-> index];
auto logic_resolver_1 = [&] () // rifk7 resolver with changes
{
const auto local1 = local-> GetPlayerAnimState ();
if (! local1)
return 0.f;
auto resolver_yaw = 0.f;
auto freestanding_yaw = 0.f;
const auto current_shot = missed_shots% 2;
float max_desync_angle = 29.f;
const auto plus_desync = record-> eye_angles.y + max_desync_angle;
const auto minus_desync = record-> eye_angles.y - max_desync_angle;
// StoreAntifreestand (local, & freestanding_yaw);
const auto diff_from_plus_desync = fabs (Math :: AngleDiff (freestanding_yaw, plus_desync));
const auto diff_from_minus_desync = fabs (Math :: AngleDiff (freestanding_yaw, minus_desync));
const auto first_yaw = diff_from_plus_desync <diff_from_minus_desync? plus_desync: minus_desync;
const auto second_yaw = diff_from_plus_desync <diff_from_minus_desync? minus_desync: plus_desync;
// const auto third_yaw = Math :: CalculateAngle (local-> get_shoot_position (), record-> player-> get_shoot_position ()). y;
switch (current_shot)
{
case 0:
resolver_yaw = first_yaw;
break;
case 1:
resolver_yaw = second_yaw;
break;
// case 2:
// resolver_yaw = third_yaw;
// break;
default:
break;
}
return resolver_yaw;
};
resolver_yaw = logic_resolver_1 ();
// logging-> info (_ ("resolver delta =% f \ n", resolver_yaw));
record-> anim_state-> m_goal_feet_yaw = Math :: normalize_yaw (resolver_yaw);
const auto current_animstate = record-> player-> GetPlayerAnimState ();
if (current_animstate)
current_animstate-> m_goal_feet_yaw = record-> anim_state-> m_goal_feet_yaw;
}
void c_resolver :: on_round_start (IGameEvent * event) //
{
resolver.last_shot_missed_index = 0;
resolver.has_target = false;
std :: fill (resolver.missed_due_to_bad_resolve, resolver.missed_due_to_bad_resolve +
ARRAYSIZE (resolver.missed_due_to_bad_resolve), 0);
std :: fill (resolver.missed_due_to_spread, resolver.missed_due_to_spread +
ARRAYSIZE (resolver.missed_due_to_spread), 0);
}
void c_resolver :: StoreAntifreestand (IBasePlayer * target, float * yaw)
{
if (! csgo-> local-> IsAlive ())
return;
if (! csgo-> weapon-> IsGun ())
return;
for (int i = 1; i <interfaces.engine-> GetMaxClients (); ++ i)
{
auto player = interfaces.ent_list-> GetClientEntity (i);
if (! player ||! player-> IsAlive () || player-> IsDormant () || player-> GetTeam () == csgo-> local-> GetTeam ())
continue;
bool Autowalled = false, HitSide1 = false, HitSide2 = false;
auto idx =
player-> GetIndex ();
float angToLocal = Math :: CalculateAngle (csgo-> local-> GetOrigin (),
player-> GetOrigin ()). y;
Vector ViewPoint = csgo-> local-> GetOrigin () + 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-> GetOrigin ();
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 (g_AutoWall.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 (g_AutoWall.CanHitFloatingPoint (ViewPointAutowallalternative, ViewPointAutowall))
{
if (sidealternative == 0)
{
HitSide1 = true;
FreestandSide [idx] = -1;
// FreestandAngle [pPlayerEntity-> EntIndex ()] = 90;
}
else if (sidealternative == 1)
{
HitSide2 = true;
FreestandSide [idx] = 1;
// FreestandAngle [pPlayerEntity-> EntIndex ()] = -90;
}
Autowalled = true;
}
}
}
}
}
} [/ LIKES]
cheers
heres the hpp file sorry
class c_resolver
{
public:
struct resolver_infos
{
bool jitter_desync = false, high_delta = false, low_delta = false, static_desync = false, lby_changed = false;
float last_lby = FLT_MAX, lby_delta = FLT_MAX, last_eyes = FLT_MAX, eye_delta = FLT_MAX, eye_lby_delta = FLT_MAX, eyes = FLT_MAX;
};
struct resolverInfo
{
public:
float fakegoalfeetyaw;
resolver_infos current_tick;
resolver_infos previous_tick;
};
bool has_target;
QAngle last_aim_angle;
QAngle last_eye_pos;
matrix last_bones[128];
IBasePlayer :: hitbox last_hitbox;
int last_shot_missed_index;
int missed_due_to_spread[65];
int missed_due_to_bad_resolve[65];
int resolver_method[65];
int base_weight[65];
int base_prev_weight[65];
int cycle_difference[65];
static void resolve2 (animation * record, IBasePlayer * player);
//static bool get_target_freestand_yaw(IBasePlayer* target, float* yaw);
int FreestandSide[64];
static void on_player_hurt(IGameEvent* event);
static void on_round_start(IGameEvent* event);
inline static resolverInfo __player[64];
inline static resolverInfo resolverinfoo;
void StoreAntifreestand(IBasePlayer* target, float* yaw);
private:
}; extern c_resolver resolve;
heres the hpp sorry
void c_resolver::resolve2(animation* record , IBasePlayer * local)
{
float resolver_yaw = 0.f;
// is it neither a bot nor a legit player?
if (!record->player || record->player->GetPlayerInfo().fakeplayer)
{
resolver.missed_due_to_bad_resolve[record->index] = 0;
return;
}
const auto animstate = record->anim_state;
if (!record->has_anim_state)
return;
const auto missed_shots = resolver.missed_due_to_bad_resolve[record->index];
auto logic_resolver_1 = [&]() // rifk7 resolver with changes
{
const auto local1 = local->GetPlayerAnimState();
if (!local1)
return 0.f;
auto resolver_yaw = 0.f;
auto freestanding_yaw = 0.f;
const auto current_shot = missed_shots % 2;
float max_desync_angle = 29.f;
const auto plus_desync = record->eye_angles.y + max_desync_angle;
const auto minus_desync = record->eye_angles.y - max_desync_angle;
//StoreAntifreestand(local, &freestanding_yaw);
const auto diff_from_plus_desync = fabs(Math::AngleDiff(freestanding_yaw, plus_desync));
const auto diff_from_minus_desync = fabs(Math::AngleDiff(freestanding_yaw, minus_desync));
const auto first_yaw = diff_from_plus_desync < diff_from_minus_desync ? plus_desync : minus_desync;
const auto second_yaw = diff_from_plus_desync < diff_from_minus_desync ? minus_desync : plus_desync;
//const auto third_yaw = Math::CalculateAngle(local->get_shoot_position(), record->player->get_shoot_position()).y;
switch (current_shot)
{
case 0:
resolver_yaw = first_yaw;
break;
case 1:
resolver_yaw = second_yaw;
break;
//case 2:
//resolver_yaw = third_yaw;
//break;
default:
break;
}
return resolver_yaw;
};
resolver_yaw = logic_resolver_1();
//logging->info(_("resolver delta = %f\n", resolver_yaw));
record->anim_state->m_goal_feet_yaw = Math::normalize_yaw(resolver_yaw);
const auto current_animstate = record->player->GetPlayerAnimState();
if (current_animstate)
current_animstate->m_goal_feet_yaw = record->anim_state->m_goal_feet_yaw;
}
void c_resolver::on_round_start(IGameEvent* event)//
{
resolver.last_shot_missed_index = 0;
resolver.has_target = false;
std::fill(resolver.missed_due_to_bad_resolve, resolver.missed_due_to_bad_resolve +
ARRAYSIZE(resolver.missed_due_to_bad_resolve), 0);
std::fill(resolver.missed_due_to_spread, resolver.missed_due_to_spread +
ARRAYSIZE(resolver.missed_due_to_spread), 0);
}
void c_resolver::StoreAntifreestand(IBasePlayer* target, float* yaw)
{
if (!csgo->local->IsAlive())
return;
if (!csgo->weapon->IsGun())
return;
for (int i = 1; i < interfaces.engine->GetMaxClients(); ++i)
{
auto player = interfaces.ent_list->GetClientEntity(i);
if (!player || !player->IsAlive() || player->IsDormant() || player->GetTeam() == csgo->local->GetTeam())
continue;
bool Autowalled = false, HitSide1 = false, HitSide2 = false;
auto idx =
player->GetIndex();
float angToLocal = Math::CalculateAngle(csgo->local->GetOrigin(),
player->GetOrigin()).y;
Vector ViewPoint = csgo->local->GetOrigin() + 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->GetOrigin();
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 (g_AutoWall.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 (g_AutoWall.CanHitFloatingPoint(ViewPointAutowallalternative, ViewPointAutowall))
{
if (sidealternative == 0)
{
HitSide1 = true;
FreestandSide[idx] = -1;
//FreestandAngle[pPlayerEntity->EntIndex()] = 90;
}
else if (sidealternative == 1)
{
HitSide2 = true;
FreestandSide[idx] = 1;
//FreestandAngle[pPlayerEntity->EntIndex()] = -90;
}
Autowalled = true;
}
}
}
}
}
}
in resolver.cpp
[LIKES = 3]
#include "Hooks.h"
#include "Resolver.h"
#include "RageBacktracking.h"
#include "Ragebot.h"
#include "AnimationFix.h"
void c_resolver :: resolve2 (animation * record, IBasePlayer * local)
{
float resolver_yaw = 0.f;
// is it neither a bot nor a legit player?
if (! record-> player || record-> player-> GetPlayerInfo (). fakeplayer)
{
resolver.missed_due_to_bad_resolve [record-> index] = 0;
return;
}
const auto animstate = record-> anim_state;
if (! record-> has_anim_state)
return;
const auto missed_shots = resolver.missed_due_to_bad_resolve [record-> index];
auto logic_resolver_1 = [&] () // rifk7 resolver with changes
{
const auto local1 = local-> GetPlayerAnimState ();
if (! local1)
return 0.f;
auto resolver_yaw = 0.f;
auto freestanding_yaw = 0.f;
const auto current_shot = missed_shots% 2;
float max_desync_angle = 29.f;
const auto plus_desync = record-> eye_angles.y + max_desync_angle;
const auto minus_desync = record-> eye_angles.y - max_desync_angle;
// StoreAntifreestand (local, & freestanding_yaw);
const auto diff_from_plus_desync = fabs (Math :: AngleDiff (freestanding_yaw, plus_desync));
const auto diff_from_minus_desync = fabs (Math :: AngleDiff (freestanding_yaw, minus_desync));
const auto first_yaw = diff_from_plus_desync <diff_from_minus_desync? plus_desync: minus_desync;
const auto second_yaw = diff_from_plus_desync <diff_from_minus_desync? minus_desync: plus_desync;
// const auto third_yaw = Math :: CalculateAngle (local-> get_shoot_position (), record-> player-> get_shoot_position ()). y;
switch (current_shot)
{
case 0:
resolver_yaw = first_yaw;
break;
case 1:
resolver_yaw = second_yaw;
break;
// case 2:
// resolver_yaw = third_yaw;
// break;
default:
break;
}
return resolver_yaw;
};
resolver_yaw = logic_resolver_1 ();
// logging-> info (_ ("resolver delta =% f \ n", resolver_yaw));
record-> anim_state-> m_goal_feet_yaw = Math :: normalize_yaw (resolver_yaw);
const auto current_animstate = record-> player-> GetPlayerAnimState ();
if (current_animstate)
current_animstate-> m_goal_feet_yaw = record-> anim_state-> m_goal_feet_yaw;
} [/ LIKES]
in the resolver.hpp
[LIKES = 3]
#include "Hooks.h"
#include "Resolver.h"
#include "RageBacktracking.h"
#include "Ragebot.h"
#include "AnimationFix.h"
void c_resolver :: resolve2 (animation * record, IBasePlayer * local)
{
float resolver_yaw = 0.f;
// is it neither a bot nor a legit player?
if (! record-> player || record-> player-> GetPlayerInfo (). fakeplayer)
{
resolver.missed_due_to_bad_resolve [record-> index] = 0;
return;
}
const auto animstate = record-> anim_state;
if (! record-> has_anim_state)
return;
const auto missed_shots = resolver.missed_due_to_bad_resolve [record-> index];
auto logic_resolver_1 = [&] () // rifk7 resolver with changes
{
const auto local1 = local-> GetPlayerAnimState ();
if (! local1)
return 0.f;
auto resolver_yaw = 0.f;
auto freestanding_yaw = 0.f;
const auto current_shot = missed_shots% 2;
float max_desync_angle = 29.f;
const auto plus_desync = record-> eye_angles.y + max_desync_angle;
const auto minus_desync = record-> eye_angles.y - max_desync_angle;
// StoreAntifreestand (local, & freestanding_yaw);
const auto diff_from_plus_desync = fabs (Math :: AngleDiff (freestanding_yaw, plus_desync));
const auto diff_from_minus_desync = fabs (Math :: AngleDiff (freestanding_yaw, minus_desync));
const auto first_yaw = diff_from_plus_desync <diff_from_minus_desync? plus_desync: minus_desync;
const auto second_yaw = diff_from_plus_desync <diff_from_minus_desync? minus_desync: plus_desync;
// const auto third_yaw = Math :: CalculateAngle (local-> get_shoot_position (), record-> player-> get_shoot_position ()). y;
switch (current_shot)
{
case 0:
resolver_yaw = first_yaw;
break;
case 1:
resolver_yaw = second_yaw;
break;
// case 2:
// resolver_yaw = third_yaw;
// break;
default:
break;
}
return resolver_yaw;
};
resolver_yaw = logic_resolver_1 ();
// logging-> info (_ ("resolver delta =% f \ n", resolver_yaw));
record-> anim_state-> m_goal_feet_yaw = Math :: normalize_yaw (resolver_yaw);
const auto current_animstate = record-> player-> GetPlayerAnimState ();
if (current_animstate)
current_animstate-> m_goal_feet_yaw = record-> anim_state-> m_goal_feet_yaw;
}
void c_resolver :: on_round_start (IGameEvent * event) //
{
resolver.last_shot_missed_index = 0;
resolver.has_target = false;
std :: fill (resolver.missed_due_to_bad_resolve, resolver.missed_due_to_bad_resolve +
ARRAYSIZE (resolver.missed_due_to_bad_resolve), 0);
std :: fill (resolver.missed_due_to_spread, resolver.missed_due_to_spread +
ARRAYSIZE (resolver.missed_due_to_spread), 0);
}
void c_resolver :: StoreAntifreestand (IBasePlayer * target, float * yaw)
{
if (! csgo-> local-> IsAlive ())
return;
if (! csgo-> weapon-> IsGun ())
return;
for (int i = 1; i <interfaces.engine-> GetMaxClients (); ++ i)
{
auto player = interfaces.ent_list-> GetClientEntity (i);
if (! player ||! player-> IsAlive () || player-> IsDormant () || player-> GetTeam () == csgo-> local-> GetTeam ())
continue;
bool Autowalled = false, HitSide1 = false, HitSide2 = false;
auto idx =
player-> GetIndex ();
float angToLocal = Math :: CalculateAngle (csgo-> local-> GetOrigin (),
player-> GetOrigin ()). y;
Vector ViewPoint = csgo-> local-> GetOrigin () + 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-> GetOrigin ();
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 (g_AutoWall.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 (g_AutoWall.CanHitFloatingPoint (ViewPointAutowallalternative, ViewPointAutowall))
{
if (sidealternative == 0)
{
HitSide1 = true;
FreestandSide [idx] = -1;
// FreestandAngle [pPlayerEntity-> EntIndex ()] = 90;
}
else if (sidealternative == 1)
{
HitSide2 = true;
FreestandSide [idx] = 1;
// FreestandAngle [pPlayerEntity-> EntIndex ()] = -90;
}
Autowalled = true;
}
}
}
}
}
} [/ LIKES]
cheers
heres the hpp file sorry
class c_resolver
{
public:
struct resolver_infos
{
bool jitter_desync = false, high_delta = false, low_delta = false, static_desync = false, lby_changed = false;
float last_lby = FLT_MAX, lby_delta = FLT_MAX, last_eyes = FLT_MAX, eye_delta = FLT_MAX, eye_lby_delta = FLT_MAX, eyes = FLT_MAX;
};
struct resolverInfo
{
public:
float fakegoalfeetyaw;
resolver_infos current_tick;
resolver_infos previous_tick;
};
bool has_target;
QAngle last_aim_angle;
QAngle last_eye_pos;
matrix last_bones[128];
IBasePlayer :: hitbox last_hitbox;
int last_shot_missed_index;
int missed_due_to_spread[65];
int missed_due_to_bad_resolve[65];
int resolver_method[65];
int base_weight[65];
int base_prev_weight[65];
int cycle_difference[65];
static void resolve2 (animation * record, IBasePlayer * player);
//static bool get_target_freestand_yaw(IBasePlayer* target, float* yaw);
int FreestandSide[64];
static void on_player_hurt(IGameEvent* event);
static void on_round_start(IGameEvent* event);
inline static resolverInfo __player[64];
inline static resolverInfo resolverinfoo;
void StoreAntifreestand(IBasePlayer* target, float* yaw);
private:
}; extern c_resolver resolve;
heres the hpp sorry
void c_resolver::resolve2(animation* record , IBasePlayer * local)
{
float resolver_yaw = 0.f;
// is it neither a bot nor a legit player?
if (!record->player || record->player->GetPlayerInfo().fakeplayer)
{
resolver.missed_due_to_bad_resolve[record->index] = 0;
return;
}
const auto animstate = record->anim_state;
if (!record->has_anim_state)
return;
const auto missed_shots = resolver.missed_due_to_bad_resolve[record->index];
auto logic_resolver_1 = [&]() // rifk7 resolver with changes
{
const auto local1 = local->GetPlayerAnimState();
if (!local1)
return 0.f;
auto resolver_yaw = 0.f;
auto freestanding_yaw = 0.f;
const auto current_shot = missed_shots % 2;
float max_desync_angle = 29.f;
const auto plus_desync = record->eye_angles.y + max_desync_angle;
const auto minus_desync = record->eye_angles.y - max_desync_angle;
//StoreAntifreestand(local, &freestanding_yaw);
const auto diff_from_plus_desync = fabs(Math::AngleDiff(freestanding_yaw, plus_desync));
const auto diff_from_minus_desync = fabs(Math::AngleDiff(freestanding_yaw, minus_desync));
const auto first_yaw = diff_from_plus_desync < diff_from_minus_desync ? plus_desync : minus_desync;
const auto second_yaw = diff_from_plus_desync < diff_from_minus_desync ? minus_desync : plus_desync;
//const auto third_yaw = Math::CalculateAngle(local->get_shoot_position(), record->player->get_shoot_position()).y;
switch (current_shot)
{
case 0:
resolver_yaw = first_yaw;
break;
case 1:
resolver_yaw = second_yaw;
break;
//case 2:
//resolver_yaw = third_yaw;
//break;
default:
break;
}
return resolver_yaw;
};
resolver_yaw = logic_resolver_1();
//logging->info(_("resolver delta = %f\n", resolver_yaw));
record->anim_state->m_goal_feet_yaw = Math::normalize_yaw(resolver_yaw);
const auto current_animstate = record->player->GetPlayerAnimState();
if (current_animstate)
current_animstate->m_goal_feet_yaw = record->anim_state->m_goal_feet_yaw;
}
void c_resolver::on_round_start(IGameEvent* event)//
{
resolver.last_shot_missed_index = 0;
resolver.has_target = false;
std::fill(resolver.missed_due_to_bad_resolve, resolver.missed_due_to_bad_resolve +
ARRAYSIZE(resolver.missed_due_to_bad_resolve), 0);
std::fill(resolver.missed_due_to_spread, resolver.missed_due_to_spread +
ARRAYSIZE(resolver.missed_due_to_spread), 0);
}
void c_resolver::StoreAntifreestand(IBasePlayer* target, float* yaw)
{
if (!csgo->local->IsAlive())
return;
if (!csgo->weapon->IsGun())
return;
for (int i = 1; i < interfaces.engine->GetMaxClients(); ++i)
{
auto player = interfaces.ent_list->GetClientEntity(i);
if (!player || !player->IsAlive() || player->IsDormant() || player->GetTeam() == csgo->local->GetTeam())
continue;
bool Autowalled = false, HitSide1 = false, HitSide2 = false;
auto idx =
player->GetIndex();
float angToLocal = Math::CalculateAngle(csgo->local->GetOrigin(),
player->GetOrigin()).y;
Vector ViewPoint = csgo->local->GetOrigin() + 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->GetOrigin();
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 (g_AutoWall.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 (g_AutoWall.CanHitFloatingPoint(ViewPointAutowallalternative, ViewPointAutowall))
{
if (sidealternative == 0)
{
HitSide1 = true;
FreestandSide[idx] = -1;
//FreestandAngle[pPlayerEntity->EntIndex()] = 90;
}
else if (sidealternative == 1)
{
HitSide2 = true;
FreestandSide[idx] = 1;
//FreestandAngle[pPlayerEntity->EntIndex()] = -90;
}
Autowalled = true;
}
}
}
}
}
}
Последнее редактирование: