From 293eda2bdce9d732fad168b5b6838bd89ce59fe8 Mon Sep 17 00:00:00 2001 From: salmonik Date: Tue, 27 Oct 2026 14:52:00 +0100 Subject: Melee killbot: 360-degree crowbar silent aim - New feature (default on): while the local player's active weapon is the crowbar, pick the nearest visible hostile NPC within the 75-unit crowbar range, sorted by distance to its collision AABB, and attack it through the normal silent-aim path (usercmd view + IN_ATTACK, movement preserved, rendered view restored at FRAME_RENDER_START). - Prefer the nearest visible hitbox center; fall back to the AABB center / closest point when bones are unavailable. Reuses the existing friendly / neutral and life-state filters and the world-only vischeck. - Detect the active weapon from the client m_hActiveWeapon handle, with the authoritative server m_hActiveWeapon handle as a fallback (client entity index from the low 16 bits). - While the crowbar is active and this feature is on, skip the gun aimbot, triggerbot and silent aim so they do not fight over the usercmd view. - Menu: Melee killbot -> Active; config [melee] active=... --- src/hl2h.cpp | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) (limited to 'src/hl2h.cpp') diff --git a/src/hl2h.cpp b/src/hl2h.cpp index 4ba30bc..ee2e990 100644 --- a/src/hl2h.cpp +++ b/src/hl2h.cpp @@ -500,34 +500,36 @@ static void do_move(int seq, float frametime) { if (jumpbug_apply(cmd, localIdx, ent, flags, vel, frametime)) note_modified(cmd, flags, vel); - if (!feature_active(FEAT_AIMBOT) || !feature_has_bind(FEAT_AIMBOT)) + bool melee = feature_active(FEAT_MELEE) && melee_weapon_active(ent); + + if (!feature_active(FEAT_AIMBOT) || !feature_has_bind(FEAT_AIMBOT) || melee) aimbot_reset_lock(); - if (!feature_active(FEAT_SILENTAIM) || !feature_has_bind(FEAT_SILENTAIM)) + if (!feature_active(FEAT_SILENTAIM) || !feature_has_bind(FEAT_SILENTAIM) || + melee) silentaim_reset_lock(); - if (feature_active(FEAT_AIMBOT)) { - static bool aim_feature_logged = false; - if (!aim_feature_logged) { - aim_feature_logged = true; - logf("aimbot: feature active (bind held)"); - } - if (aimbot_apply(cmd)) { - const float *vel = (const float *)(e + g_net.velocity); + if (melee) { + if (melee_aimbot_apply(cmd)) note_modified(cmd, flags, vel); + } else { + if (feature_active(FEAT_AIMBOT)) { + static bool aim_feature_logged = false; + if (!aim_feature_logged) { + aim_feature_logged = true; + logf("aimbot: feature active (bind held)"); + } + if (aimbot_apply(cmd)) + note_modified(cmd, flags, vel); } - } - if (feature_active(FEAT_TRIGGERBOT)) { - if (triggerbot_apply(cmd)) { - const float *vel = (const float *)(e + g_net.velocity); - note_modified(cmd, flags, vel); + if (feature_active(FEAT_TRIGGERBOT)) { + if (triggerbot_apply(cmd)) + note_modified(cmd, flags, vel); } - } - if (feature_active(FEAT_SILENTAIM)) { - if (silent_aim_apply(cmd)) { - const float *vel = (const float *)(e + g_net.velocity); - note_modified(cmd, flags, vel); + if (feature_active(FEAT_SILENTAIM)) { + if (silent_aim_apply(cmd)) + note_modified(cmd, flags, vel); } } } -- cgit v1.2.3