-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRCS.cpp
More file actions
38 lines (30 loc) · 958 Bytes
/
RCS.cpp
File metadata and controls
38 lines (30 loc) · 958 Bytes
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
#include "RCS.hpp"
RCS::RCS(Memory* mem, Client* client, Engine* engine): mem(mem), client(client), engine(engine) {
_newViewAngles = Vector2(0.0f, 0.0f);
_oldViewAngles = Vector2(0.0f, 0.0f);
}
void RCS::loop(bool& isAimWorking){
_newViewAngles = engine->clientState->dwViewAngles();
auto m_aimPunchAngle = client->localPlayer->m_aimPunchAngle();
if (client->localPlayer->m_iShotsFired() > 1)
{
_newViewAngles.x -= (m_aimPunchAngle.x - (!isAimWorking ? _oldViewAngles.x : 0)) * (_scale * 0.02f);
_newViewAngles.y -= (m_aimPunchAngle.y - (!isAimWorking ? _oldViewAngles.y : 0)) * (_scale * 0.02f);
_newViewAngles.clamp();
engine->clientState->dwViewAngles(_newViewAngles);
}
_oldViewAngles.x = m_aimPunchAngle.x;
_oldViewAngles.y = m_aimPunchAngle.y;
}
float RCS::scale(){
return this->_scale;
}
void RCS::scale(float v){
if (v < 0.0f) {
v = 0.0f;
}
if (v > 100.0f) {
v = 100.0f;
}
_scale = v;
}