From d44d75991ae24146df535a91a7d0446fcda21f5d Mon Sep 17 00:00:00 2001 From: salmonik Date: Mon, 26 Oct 2026 17:50:04 +0100 Subject: ABH: silent auto-ABH on the jump tick - on landing with jump held, face opposite the horizontal velocity and zero forward/side movement for that tick; the HL2 jump speed-bound subtraction then accelerates along the velocity (the classic no-input ABH exploit) - works standalone or with bhop; bhop's auto-strafe still applies in air when enabled - rendered view is restored at FRAME_RENDER_START via the existing hook, so the camera does not flip around --- src/hl2h.cpp | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/hl2h.cpp b/src/hl2h.cpp index 0491fd9..f3aa26f 100644 --- a/src/hl2h.cpp +++ b/src/hl2h.cpp @@ -210,10 +210,11 @@ static void do_move(int seq) { bool inwater = (flags & FL_INWATER) != 0; bool bhop_on = feature_active(FEAT_BHOP); + bool abh_on = feature_active(FEAT_ABH); static bool lastground = false; - if (bhop_on && (cmd->buttons & IN_JUMP)) { + if ((bhop_on || abh_on) && (cmd->buttons & IN_JUMP)) { if (inwater && (cmd->buttons & IN_DUCK)) { lastground = onground; return; @@ -233,13 +234,30 @@ static void do_move(int seq) { if (!onground) { lastground = false; cmd->buttons &= ~IN_JUMP; - if (!inwater && bhop_autostrafe_enabled()) + if (bhop_on && !inwater && bhop_autostrafe_enabled()) apply_autostrafe(cmd, vel); note_modified(cmd, flags, vel); } else if (!lastground) { lastground = true; - if (!backmove) + if (abh_on) { + // ABH jump tick: face opposite the horizontal velocity, hold no + // directional keys. The jump speed-bound subtraction then flips into + // acceleration along the velocity. The rendered view is restored at + // FRAME_RENDER_START so the camera does not spin around. + float speed2d = sqrtf(vel[0] * vel[0] + vel[1] * vel[1]); + if (speed2d > 1.0f) { + float vyaw = atan2f(vel[1], vel[0]) * 180.0f / PI_F; + float fake = vyaw + 180.0f; + while (fake > 180.0f) fake -= 360.0f; + while (fake < -180.0f) fake += 360.0f; + cmd->viewangles[1] = fake; + cmd->forwardmove = 0.0f; + cmd->sidemove = 0.0f; + set_silent_restore(QAngle{g_cam_view.x, g_cam_view.y, g_cam_view.z}); + } + } else if (!backmove) { cmd->forwardmove = -0.1f; + } note_modified(cmd, flags, vel); } } -- cgit v1.2.3