diff options
| author | salmonik <salmonik@tuta.io> | 2026-10-27 13:19:00 +0100 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-10-27 13:22:27 +0100 |
| commit | bb99c978c5f982e80a3007101fd61fe23635e242 (patch) | |
| tree | 749acafe3d2c4fcffeb2060c7a4a92c49aa69407 /src/menu.cpp | |
| parent | Speed graph: show current speed at the top-right (diff) | |
| download | hl2h-bb99c978c5f982e80a3007101fd61fe23635e242.tar.gz hl2h-bb99c978c5f982e80a3007101fd61fe23635e242.zip | |
Jumpbug: automatic duck+jump on damaging falls
- Predict the landing speed from the current vertical velocity and a swept
standing-hull ground trace; engage only when it exceeds
PLAYER_MAX_SAFE_FALL_SPEED.
- Press duck one command before the unduck window so FinishDuck's 36-unit
origin raise places the feet ~37 units above the floor.
- On the next command release duck and press jump: PlayerMove runs Duck()
before CheckJumpButton, so FinishUnDuck sets ground, the jump executes, and
CheckFalling never sees ground for the fall-damage check.
- Measure the per-command fall from consecutive airborne origins instead of a
fixed tick interval; clear IN_JUMP while waiting so the pogo latch is clear.
- New Movement -> Jumpbug -> Active toggle (default on), config [jumpbug].
Diffstat (limited to 'src/menu.cpp')
| -rw-r--r-- | src/menu.cpp | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/src/menu.cpp b/src/menu.cpp index 3e20cb3..0ed89d4 100644 --- a/src/menu.cpp +++ b/src/menu.cpp | |||
| @@ -62,6 +62,7 @@ static FeatureState g_bhop{true, 0}; | |||
| 62 | static bool g_bhop_autostrafe = true; | 62 | static bool g_bhop_autostrafe = true; |
| 63 | 63 | ||
| 64 | static FeatureState g_abh{true, 0}; | 64 | static FeatureState g_abh{true, 0}; |
| 65 | static FeatureState g_jumpbug{true, 0}; | ||
| 65 | static FeatureState g_esp{true, 0}; | 66 | static FeatureState g_esp{true, 0}; |
| 66 | static FeatureState g_aimbot{true, 604}; // default Mouse5, rebindable in menu | 67 | static FeatureState g_aimbot{true, 604}; // default Mouse5, rebindable in menu |
| 67 | static FeatureState g_triggerbot{true, 603}; // default Mouse4 | 68 | static FeatureState g_triggerbot{true, 603}; // default Mouse4 |
| @@ -96,6 +97,8 @@ static MenuNode g_bhop_active{NODE_TOGGLE, "Active", false, 0, {}, &g_bhop.activ | |||
| 96 | static MenuNode g_bhop_autostrafe_node{NODE_TOGGLE, "Uni-directional auto-strafe", false, 0, {}, &g_bhop_autostrafe, nullptr, nullptr}; | 97 | static MenuNode g_bhop_autostrafe_node{NODE_TOGGLE, "Uni-directional auto-strafe", false, 0, {}, &g_bhop_autostrafe, nullptr, nullptr}; |
| 97 | static MenuNode g_abh_feat{NODE_FEATURE, "ABH", false, 1, {}, nullptr, nullptr, nullptr}; | 98 | static MenuNode g_abh_feat{NODE_FEATURE, "ABH", false, 1, {}, nullptr, nullptr, nullptr}; |
| 98 | static MenuNode g_abh_active{NODE_TOGGLE, "Active", false, 0, {}, &g_abh.active, nullptr, nullptr}; | 99 | static MenuNode g_abh_active{NODE_TOGGLE, "Active", false, 0, {}, &g_abh.active, nullptr, nullptr}; |
| 100 | static MenuNode g_jumpbug_feat{NODE_FEATURE, "Jumpbug", false, 1, {}, nullptr, nullptr, nullptr}; | ||
| 101 | static MenuNode g_jumpbug_active{NODE_TOGGLE, "Active", false, 0, {}, &g_jumpbug.active, nullptr, nullptr}; | ||
| 99 | static MenuNode g_esp_feat{NODE_FEATURE, "ESP", false, 1, {}, nullptr, nullptr, nullptr}; | 102 | static MenuNode g_esp_feat{NODE_FEATURE, "ESP", false, 1, {}, nullptr, nullptr, nullptr}; |
| 100 | static MenuNode g_esp_active{NODE_TOGGLE, "Active", false, 0, {}, &g_esp.active, nullptr, nullptr}; | 103 | static MenuNode g_esp_active{NODE_TOGGLE, "Active", false, 0, {}, &g_esp.active, nullptr, nullptr}; |
| 101 | static MenuNode g_esp_opt_nodes[ESP_OPT_COUNT] = { | 104 | static MenuNode g_esp_opt_nodes[ESP_OPT_COUNT] = { |
| @@ -145,6 +148,9 @@ static void build_tree() { | |||
| 145 | g_bhop_feat.children[1] = &g_bhop_autostrafe_node; | 148 | g_bhop_feat.children[1] = &g_bhop_autostrafe_node; |
| 146 | g_bhop_feat.child_count = 2; | 149 | g_bhop_feat.child_count = 2; |
| 147 | g_abh_feat.children[0] = &g_abh_active; | 150 | g_abh_feat.children[0] = &g_abh_active; |
| 151 | g_abh_feat.child_count = 1; | ||
| 152 | g_jumpbug_feat.children[0] = &g_jumpbug_active; | ||
| 153 | g_jumpbug_feat.child_count = 1; | ||
| 148 | g_esp_feat.children[0] = &g_esp_active; | 154 | g_esp_feat.children[0] = &g_esp_active; |
| 149 | g_aimbot_feat.children[0] = &g_aimbot_active; | 155 | g_aimbot_feat.children[0] = &g_aimbot_active; |
| 150 | g_aimbot_feat.children[1] = &g_aimbot_bind; | 156 | g_aimbot_feat.children[1] = &g_aimbot_bind; |
| @@ -169,11 +175,12 @@ static void build_tree() { | |||
| 169 | g_esp_feat.child_count = ESP_OPT_COUNT + 1; | 175 | g_esp_feat.child_count = ESP_OPT_COUNT + 1; |
| 170 | g_root.children[0] = &g_bhop_feat; | 176 | g_root.children[0] = &g_bhop_feat; |
| 171 | g_root.children[1] = &g_abh_feat; | 177 | g_root.children[1] = &g_abh_feat; |
| 172 | g_root.children[2] = &g_esp_feat; | 178 | g_root.children[2] = &g_jumpbug_feat; |
| 173 | g_root.children[3] = &g_aimbot_feat; | 179 | g_root.children[3] = &g_esp_feat; |
| 174 | g_root.children[4] = &g_triggerbot_feat; | 180 | g_root.children[4] = &g_aimbot_feat; |
| 175 | g_root.children[5] = &g_silentaim_feat; | 181 | g_root.children[5] = &g_triggerbot_feat; |
| 176 | g_root.child_count = 6; | 182 | g_root.children[6] = &g_silentaim_feat; |
| 183 | g_root.child_count = 7; | ||
| 177 | } | 184 | } |
| 178 | 185 | ||
| 179 | static int g_depth[48]; // depth of each visible row (for indentation) | 186 | static int g_depth[48]; // depth of each visible row (for indentation) |
| @@ -295,6 +302,7 @@ static void config_save() { | |||
| 295 | fprintf(f, "[bhop]\nactive=%d\nbind=%d\nautostrafe=%d\n", g_bhop.active, | 302 | fprintf(f, "[bhop]\nactive=%d\nbind=%d\nautostrafe=%d\n", g_bhop.active, |
| 296 | g_bhop.bind, g_bhop_autostrafe); | 303 | g_bhop.bind, g_bhop_autostrafe); |
| 297 | fprintf(f, "[abh]\nactive=%d\nbind=%d\n", g_abh.active, g_abh.bind); | 304 | fprintf(f, "[abh]\nactive=%d\nbind=%d\n", g_abh.active, g_abh.bind); |
| 305 | fprintf(f, "[jumpbug]\nactive=%d\n", g_jumpbug.active); | ||
| 298 | fprintf(f, "[aimbot]\nactive=%d\nbind=%d\nsmooth=%d\nvischeck=%d\n" | 306 | fprintf(f, "[aimbot]\nactive=%d\nbind=%d\nsmooth=%d\nvischeck=%d\n" |
| 299 | "fov=%d\nfov_circle=%d\n" | 307 | "fov=%d\nfov_circle=%d\n" |
| 300 | "bone_head=%d\nbone_torso=%d\nbone_larm=%d\nbone_rarm=%d\n" | 308 | "bone_head=%d\nbone_torso=%d\nbone_larm=%d\nbone_rarm=%d\n" |
| @@ -332,6 +340,8 @@ static void config_load() { | |||
| 332 | cur = &g_bhop; | 340 | cur = &g_bhop; |
| 333 | else if (strstr(line, "[abh]")) | 341 | else if (strstr(line, "[abh]")) |
| 334 | cur = &g_abh; | 342 | cur = &g_abh; |
| 343 | else if (strstr(line, "[jumpbug]")) | ||
| 344 | cur = &g_jumpbug; | ||
| 335 | else if (strstr(line, "[esp]")) | 345 | else if (strstr(line, "[esp]")) |
| 336 | cur = &g_esp; | 346 | cur = &g_esp; |
| 337 | else if (strstr(line, "[aimbot]")) | 347 | else if (strstr(line, "[aimbot]")) |
| @@ -516,10 +526,10 @@ static bool key_pressed(int sc) { | |||
| 516 | // feature gate queried from hl2h.cpp do_move(): feature must be Active AND | 526 | // feature gate queried from hl2h.cpp do_move(): feature must be Active AND |
| 517 | // its bind key held (always-on when unbound). | 527 | // its bind key held (always-on when unbound). |
| 518 | static FeatureState *feature_state(int feature) { | 528 | static FeatureState *feature_state(int feature) { |
| 519 | static FeatureState *feats[6] = {&g_bhop, &g_abh, &g_esp, | 529 | static FeatureState *feats[7] = {&g_bhop, &g_abh, &g_esp, |
| 520 | &g_aimbot, &g_triggerbot, | 530 | &g_aimbot, &g_triggerbot, &g_silentaim, |
| 521 | &g_silentaim}; | 531 | &g_jumpbug}; |
| 522 | if (feature < 0 || feature > 5) | 532 | if (feature < 0 || feature > 6) |
| 523 | return nullptr; | 533 | return nullptr; |
| 524 | return feats[feature]; | 534 | return feats[feature]; |
| 525 | } | 535 | } |
