summaryrefslogtreecommitdiffstats
path: root/src/menu.cpp
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-10-27 13:48:27 +0100
committersalmonik <salmonik@tuta.io>2026-10-27 13:48:27 +0100
commit471f022f449a18766fedb1ff0a4204a933b95b9c (patch)
tree499fcd29f1c9f7933aade3f8ffad88b3ef10f377 /src/menu.cpp
parentscript: change the map for tests (diff)
downloadhl2h-471f022f449a18766fedb1ff0a4204a933b95b9c.tar.gz
hl2h-471f022f449a18766fedb1ff0a4204a933b95b9c.zip
Jumpbug: optional velocity-timed assist
The unduck window is only 2 units, while a 625-ups fall moves ~9.3 units per 66.7 Hz movement command, so pure jumpbug is ~20% reliable at that speed. - Add Jumpbug -> Assist timing (default off). When the natural next command would skip [36,38], pin the post-command ducked distance to 37 by writing the vertical velocity for that command. Pure jumpbug remains available with the option off. - Resolve the client local m_vecAbsVelocity (0x11C) via the client datamap and the server m_vecAbsVelocity (0x228) via the server datamap. - Write both the authoritative server velocity (what SetupMove reads through GetAbsVelocity) and the local prediction fields, so the next CreateMove sees the assisted origin on both sides. - Do not write the server m_vecVelocity directly: the datamap scan finds two same-named entries (0x1C and 0x29C); SetAbsVelocity syncs it after movement.
Diffstat (limited to 'src/menu.cpp')
-rw-r--r--src/menu.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/menu.cpp b/src/menu.cpp
index 0ed89d4..4f76529 100644
--- a/src/menu.cpp
+++ b/src/menu.cpp
@@ -63,6 +63,7 @@ static bool g_bhop_autostrafe = true;
63 63
64static FeatureState g_abh{true, 0}; 64static FeatureState g_abh{true, 0};
65static FeatureState g_jumpbug{true, 0}; 65static FeatureState g_jumpbug{true, 0};
66static bool g_jumpbug_assist = false;
66static FeatureState g_esp{true, 0}; 67static FeatureState g_esp{true, 0};
67static FeatureState g_aimbot{true, 604}; // default Mouse5, rebindable in menu 68static FeatureState g_aimbot{true, 604}; // default Mouse5, rebindable in menu
68static FeatureState g_triggerbot{true, 603}; // default Mouse4 69static FeatureState g_triggerbot{true, 603}; // default Mouse4
@@ -99,6 +100,7 @@ static MenuNode g_abh_feat{NODE_FEATURE, "ABH", false, 1, {}, nullptr, nullptr,
99static MenuNode g_abh_active{NODE_TOGGLE, "Active", false, 0, {}, &g_abh.active, nullptr, nullptr}; 100static MenuNode g_abh_active{NODE_TOGGLE, "Active", false, 0, {}, &g_abh.active, nullptr, nullptr};
100static MenuNode g_jumpbug_feat{NODE_FEATURE, "Jumpbug", false, 1, {}, nullptr, nullptr, nullptr}; 101static MenuNode g_jumpbug_feat{NODE_FEATURE, "Jumpbug", false, 1, {}, nullptr, nullptr, nullptr};
101static MenuNode g_jumpbug_active{NODE_TOGGLE, "Active", false, 0, {}, &g_jumpbug.active, nullptr, nullptr}; 102static MenuNode g_jumpbug_active{NODE_TOGGLE, "Active", false, 0, {}, &g_jumpbug.active, nullptr, nullptr};
103static MenuNode g_jumpbug_assist_node{NODE_TOGGLE, "Assist timing", false, 0, {}, &g_jumpbug_assist, nullptr, nullptr};
102static MenuNode g_esp_feat{NODE_FEATURE, "ESP", false, 1, {}, nullptr, nullptr, nullptr}; 104static MenuNode g_esp_feat{NODE_FEATURE, "ESP", false, 1, {}, nullptr, nullptr, nullptr};
103static MenuNode g_esp_active{NODE_TOGGLE, "Active", false, 0, {}, &g_esp.active, nullptr, nullptr}; 105static MenuNode g_esp_active{NODE_TOGGLE, "Active", false, 0, {}, &g_esp.active, nullptr, nullptr};
104static MenuNode g_esp_opt_nodes[ESP_OPT_COUNT] = { 106static MenuNode g_esp_opt_nodes[ESP_OPT_COUNT] = {
@@ -150,7 +152,8 @@ static void build_tree() {
150 g_abh_feat.children[0] = &g_abh_active; 152 g_abh_feat.children[0] = &g_abh_active;
151 g_abh_feat.child_count = 1; 153 g_abh_feat.child_count = 1;
152 g_jumpbug_feat.children[0] = &g_jumpbug_active; 154 g_jumpbug_feat.children[0] = &g_jumpbug_active;
153 g_jumpbug_feat.child_count = 1; 155 g_jumpbug_feat.children[1] = &g_jumpbug_assist_node;
156 g_jumpbug_feat.child_count = 2;
154 g_esp_feat.children[0] = &g_esp_active; 157 g_esp_feat.children[0] = &g_esp_active;
155 g_aimbot_feat.children[0] = &g_aimbot_active; 158 g_aimbot_feat.children[0] = &g_aimbot_active;
156 g_aimbot_feat.children[1] = &g_aimbot_bind; 159 g_aimbot_feat.children[1] = &g_aimbot_bind;
@@ -302,7 +305,8 @@ static void config_save() {
302 fprintf(f, "[bhop]\nactive=%d\nbind=%d\nautostrafe=%d\n", g_bhop.active, 305 fprintf(f, "[bhop]\nactive=%d\nbind=%d\nautostrafe=%d\n", g_bhop.active,
303 g_bhop.bind, g_bhop_autostrafe); 306 g_bhop.bind, g_bhop_autostrafe);
304 fprintf(f, "[abh]\nactive=%d\nbind=%d\n", g_abh.active, g_abh.bind); 307 fprintf(f, "[abh]\nactive=%d\nbind=%d\n", g_abh.active, g_abh.bind);
305 fprintf(f, "[jumpbug]\nactive=%d\n", g_jumpbug.active); 308 fprintf(f, "[jumpbug]\nactive=%d\nassist=%d\n", g_jumpbug.active,
309 (int)g_jumpbug_assist);
306 fprintf(f, "[aimbot]\nactive=%d\nbind=%d\nsmooth=%d\nvischeck=%d\n" 310 fprintf(f, "[aimbot]\nactive=%d\nbind=%d\nsmooth=%d\nvischeck=%d\n"
307 "fov=%d\nfov_circle=%d\n" 311 "fov=%d\nfov_circle=%d\n"
308 "bone_head=%d\nbone_torso=%d\nbone_larm=%d\nbone_rarm=%d\n" 312 "bone_head=%d\nbone_torso=%d\nbone_larm=%d\nbone_rarm=%d\n"
@@ -332,7 +336,8 @@ static void config_load() {
332 return; 336 return;
333 char line[256]; 337 char line[256];
334 FeatureState *cur = nullptr; 338 FeatureState *cur = nullptr;
335 bool in_esp = false, in_bhop = false, in_aim = false, in_silent = false; 339 bool in_esp = false, in_bhop = false, in_aim = false, in_silent = false,
340 in_jumpbug = false;
336 while (fgets(line, sizeof(line), f)) { 341 while (fgets(line, sizeof(line), f)) {
337 line[strcspn(line, "\r\n")] = 0; 342 line[strcspn(line, "\r\n")] = 0;
338 if (line[0] == '[') { 343 if (line[0] == '[') {
@@ -356,6 +361,7 @@ static void config_load() {
356 in_bhop = (cur == &g_bhop); 361 in_bhop = (cur == &g_bhop);
357 in_aim = (cur == &g_aimbot); 362 in_aim = (cur == &g_aimbot);
358 in_silent = (cur == &g_silentaim); 363 in_silent = (cur == &g_silentaim);
364 in_jumpbug = (cur == &g_jumpbug);
359 } else if (cur) { 365 } else if (cur) {
360 char *eq = strchr(line, '='); 366 char *eq = strchr(line, '=');
361 if (!eq) 367 if (!eq)
@@ -365,6 +371,9 @@ static void config_load() {
365 if (in_bhop && strcmp(key, "autostrafe") == 0) { 371 if (in_bhop && strcmp(key, "autostrafe") == 0) {
366 g_bhop_autostrafe = atoi(val) != 0; 372 g_bhop_autostrafe = atoi(val) != 0;
367 } 373 }
374 if (in_jumpbug && strcmp(key, "assist") == 0) {
375 g_jumpbug_assist = atoi(val) != 0;
376 }
368 if (in_aim) { 377 if (in_aim) {
369 if (strcmp(key, "smooth") == 0) { 378 if (strcmp(key, "smooth") == 0) {
370 int v = atoi(val); 379 int v = atoi(val);
@@ -557,6 +566,8 @@ bool esp_option(int opt) {
557 566
558bool bhop_autostrafe_enabled() { return g_bhop_autostrafe; } 567bool bhop_autostrafe_enabled() { return g_bhop_autostrafe; }
559 568
569bool jumpbug_assist_enabled() { return g_jumpbug_assist; }
570
560unsigned aimbot_bone_mask() { 571unsigned aimbot_bone_mask() {
561 unsigned m = 0; 572 unsigned m = 0;
562 if (g_aim_bones[AIM_BONE_HEAD]) 573 if (g_aim_bones[AIM_BONE_HEAD])