Skip to content

Commit 9b0d1c4

Browse files
committed
add rcs smooth
1 parent 21200b3 commit 9b0d1c4

File tree

4 files changed

+21
-11
lines changed

4 files changed

+21
-11
lines changed

include/config.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,15 @@ struct WeaponConfig {
5353
i32 start_bullet = 2;
5454
f32 fov = 2.5f;
5555
f32 smooth = 5.0f;
56+
f32 rcs_smooth = 1.0f;
5657

5758
bool enabled = false;
5859
bool aim_lock = false;
5960
bool visibility_check = true;
6061
bool multibone = true;
6162
bool flash_check = true;
63+
64+
bool rcs = false;
6265

6366
toml::table to_toml() const;
6467
static WeaponConfig from_toml(const toml::table &table);
@@ -160,7 +163,6 @@ struct AimbotConfig {
160163
KeyCode hotkey = KeyCode::Mouse5;
161164

162165
bool fov_circle = false;
163-
bool rcs = false;
164166

165167
toml::table to_toml() const;
166168
static AimbotConfig from_toml(const toml::table &table);

src/config.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,13 @@ toml::table WeaponConfig::to_toml() const {
4848
{"start_bullet", start_bullet},
4949
{"fov", fov},
5050
{"smooth", smooth},
51+
{"rcs_smooth", rcs_smooth},
5152
{"enabled", enabled},
5253
{"aim_lock", aim_lock},
5354
{"visibility_check", visibility_check},
5455
{"multibone", multibone},
5556
{"flash_check", flash_check},
57+
{"rcs", rcs},
5658
};
5759
}
5860

@@ -61,11 +63,13 @@ WeaponConfig WeaponConfig::from_toml(const toml::table &table) {
6163
cfg.start_bullet = table["start_bullet"].value_or(cfg.start_bullet);
6264
cfg.fov = table["fov"].value_or(cfg.fov);
6365
cfg.smooth = table["smooth"].value_or(cfg.smooth);
66+
cfg.rcs_smooth = table["smooth_rcs"].value_or(cfg.rcs_smooth);
6467
cfg.enabled = table["enabled"].value_or(cfg.enabled);
6568
cfg.aim_lock = table["aim_lock"].value_or(cfg.aim_lock);
6669
cfg.visibility_check = table["visibility_check"].value_or(cfg.visibility_check);
6770
cfg.multibone = table["multibone"].value_or(cfg.multibone);
6871
cfg.flash_check = table["flash_check"].value_or(cfg.flash_check);
72+
cfg.rcs = table["rcs"].value_or(cfg.rcs);
6973
return cfg;
7074
}
7175

@@ -78,8 +82,7 @@ toml::table AimbotConfig::to_toml() const {
7882
{"weapons", weapons_table},
7983
{"global", global.to_toml()},
8084
{"hotkey", static_cast<int>(hotkey)},
81-
{"fov_circle", fov_circle},
82-
{"rcs", rcs}};
85+
{"fov_circle", fov_circle}};
8386
}
8487

8588
AimbotConfig AimbotConfig::from_toml(const toml::table &table) {
@@ -95,7 +98,6 @@ AimbotConfig AimbotConfig::from_toml(const toml::table &table) {
9598
}
9699
cfg.hotkey = static_cast<KeyCode>(table["hotkey"].value_or(static_cast<int>(cfg.hotkey)));
97100
cfg.fov_circle = table["fov_circle"].value_or(cfg.fov_circle);
98-
cfg.rcs = table["rcs"].value_or(cfg.rcs);
99101
return cfg;
100102
}
101103

src/cs2/rcs.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@
55
glm::vec2 mouse_movement {0.0f};
66

77
void Rcs() {
8-
if (!config.aimbot.rcs) {
8+
const std::optional<Player> local_player = Player::LocalPlayer();
9+
if (!local_player) {
910
return;
1011
}
1112

12-
const std::optional<Player> local_player = Player::LocalPlayer();
13-
if (!local_player) {
13+
const WeaponConfig &aim_config = config.aimbot.CurrentWeaponConfig(local_player->WeaponName());
14+
15+
if (!aim_config.rcs) {
1416
return;
1517
}
1618

@@ -38,6 +40,7 @@ void Rcs() {
3840
const glm::vec2 delta = mouse_angle - mouse_movement;
3941

4042
mouse_movement += round(delta);
43+
mouse_movement /= aim_config.rcs_smooth + 1.0f;
4144

4245
MouseMove(glm::ivec2 {static_cast<i32>(delta.x), static_cast<i32>(delta.y)});
4346
}

src/gui.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,13 @@ void Gui() {
412412
}
413413
ImGui::Checkbox("Flash Check", &aim_config.flash_check);
414414

415+
Spacer();
416+
Title("Recoil");
417+
418+
ImGui::Checkbox("RCS", &aim_config.rcs);
419+
ImGui::SetNextItemWidth(sizes.drag_width);
420+
ImGui::DragFloat("Smooth", &aim_config.rcs_smooth, 0.02f, 0.0f, 10.0f, "%.1f");
421+
415422
if (!aimbot_global) {
416423
if (ImGui::Button("Reset Weapon Settings")) {
417424
aim_config = WeaponConfig();
@@ -479,10 +486,6 @@ void Gui() {
479486
}
480487
}
481488

482-
Spacer();
483-
Title("Recoil");
484-
ImGui::Checkbox("RCS", &config.aimbot.rcs);
485-
486489
ImGui::EndChild();
487490
} else if (active_tab == Tab::Players) {
488491
ImGui::BeginChild(

0 commit comments

Comments
 (0)