Vector2 rcsOldPunch;
void standalone_rcs(int numShots, Vector2 aimPuch, float sensitivity)
{
if (numShots > 1)
{
float x = (aimPuch.x - rcsOldPunch.x) * -1.0f;
float y = (aimPuch.y - rcsOldPunch.y) * -1.0f;
int mouse_angle_x = (int)(((y * 2.0f) / sensitivity) / -0.022f);
int mouse_angle_y = (int)(((x * 2.0f) / sensitivity) / 0.022f);
mouse_event(MOUSEEVENTF_MOVE, mouse_angle_x, mouse_angle_y, NULL, NULL);
}
rcsOldPunch = aimPuch;
}
const auto localPlayer = mem::Read<LONGLONG>(mem::baseAddress + offsets::dwLocalPlayerPawn);
if (localPlayer) {
uintptr_t DW_Sensitivity = mem::Read<uintptr_t>(mem::baseAddress + offsets::dwSensitivity); // private
float Sensitivity = mem::Read<float>(DW_Sensitivity + offsets::dwSensitivity_sensitivity);
c_utl_vector punchCache = mem::Read<c_utl_vector>(localPlayer + offsets::m_aimPunchCache);
Vector2 punchAngle;
int numShots = mem::Read<int>(localPlayer + offsets::m_iShotsFired);
if (punchCache.count > 0 && punchCache.count <= 0xFFFF)
{
punchAngle = mem::Read<Vector2>(punchCache.data + (punchCache.count - 1) * sizeof(Vector3));
if (!punchAngle.isZero())
{
standalone_rcs(numShots, punchAngle, Sensitivity);
}
}
}