forked from alimb2/Ayyware-Full-Fixed-Updated-2019
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathResolver.cpp
More file actions
83 lines (73 loc) · 3.09 KB
/
Copy pathResolver.cpp
File metadata and controls
83 lines (73 loc) · 3.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
// Don't take credits for this ;) Joplin / Manhhao are the first uploaders ;)
#include <iostream>
#include "Resolver.h"
int Globals::Shots = 0;
bool Globals::change;
CUserCmd* Globals::UserCmd;
int Globals::TargetID;
IClientEntity* Globals::Target;
void R::Resolve()
{
IClientEntity *pLocal = Interfaces::EntList->GetClientEntity(Interfaces::Engine->GetLocalPlayer());
for (int i = 0; i < Interfaces::Engine->GetMaxClients(); ++i)
{
IClientEntity *pEntity = Interfaces::EntList->GetClientEntity(i);
if (!pEntity || pEntity->IsDormant() || !pEntity->IsAlive())
continue;
if (pEntity->GetTeamNum() == pLocal->GetTeamNum() || !pLocal->IsAlive())
continue;
Vector* eyeAngles = pEntity->GetEyeAnglesPointer();
if (Menu::Window.RageBotTab.AccuracyResolver.GetIndex() == 1 || Menu::Window.RageBotTab.AccuracyResolver.GetIndex() == 2)
{
if (pEntity != Globals::Target) continue;
Vector AimAngle;
CalcAngleYawOnly(pEntity->GetEyePosition(), pLocal->GetAbsOrigin2(), AimAngle);
NormalizeVector(AimAngle);
static float StoredYaw = 0;
static bool bLowerBodyIsUpdated = false;
if (pEntity->GetLowerBodyYaw() != StoredYaw) bLowerBodyIsUpdated = true;
else bLowerBodyIsUpdated = false;
if (bLowerBodyIsUpdated) StoredYaw = pEntity->GetLowerBodyYaw();
if (pEntity->GetFlags() & FL_ONGROUND && pEntity->GetVelocity().Length2D() != 0) eyeAngles->y = pEntity->GetLowerBodyYaw();
else
{
if (Menu::Window.RageBotTab.AccuracyResolver.GetIndex() == 1 || Menu::Window.RageBotTab.AccuracyResolver.GetIndex() == 2)
{
int num = Globals::Shots % 5;
switch (num) {
case 0:eyeAngles->y = AimAngle.y - 0; break;
case 1:eyeAngles->y = AimAngle.y - 15; break;
case 2:eyeAngles->y = AimAngle.y + 40; break;
case 3:eyeAngles->y = AimAngle.y - 40; break;
case 4:eyeAngles->y = AimAngle.y + 15; break;
}
}
/* if (Menu::Window.RageBotTab.AccuracyAutoResolver.GetIndex() == 4 && eyeAngles->y != pEntity->GetLowerBodyYaw())
{
int num = Globals::Shots % 9;
switch (num) {
case 0:eyeAngles->y = AimAngle.y - 0; break;
case 1:eyeAngles->y = AimAngle.y + 45; break;
case 2:eyeAngles->y = AimAngle.y + 90; break;
case 3:eyeAngles->y = AimAngle.y + 135; break;
case 4:eyeAngles->y = AimAngle.y + 180; break;
case 5:eyeAngles->y = AimAngle.y + 225; break;
case 6:eyeAngles->y = AimAngle.y + 270; break;
case 7:eyeAngles->y = AimAngle.y + 315; break;
case 8:eyeAngles->y = AimAngle.y + 360; break;
}
} */
}
if (Menu::Window.RageBotTab.AccuracyResolver.GetIndex() == 2) //pitch
{
std::string strPitch = std::to_string(eyeAngles->x);
if (eyeAngles->x < -179.f) eyeAngles->x += 360.f;
else if (eyeAngles->x > 90.0 || eyeAngles->x < -90.0) eyeAngles->x = 89.f;
else if (eyeAngles->x > 89.0 && eyeAngles->x < 91.0) eyeAngles->x -= 90.f;
else if (eyeAngles->x > 179.0 && eyeAngles->x < 181.0) eyeAngles->x -= 180;
else if (eyeAngles->x > -179.0 && eyeAngles->x < -181.0) eyeAngles->x += 180;
else if (fabs(eyeAngles->x) == 0) eyeAngles->x = std::copysign(89.0f, eyeAngles->x);
}
}
}
}