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/netvars.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/netvars.cpp') diff --git a/src/netvars.cpp b/src/netvars.cpp index 98ebe31..3b2d3b8 100644 --- a/src/netvars.cpp +++ b/src/netvars.cpp @@ -89,6 +89,9 @@ static void collect_netvars(uintptr_t table, uintptr_t base_off, int depth) { g_net.health = (int)(base_off + (uint32_t)poff); } else if (strcmp(pname2, "m_iMaxHealth") == 0 && g_net.maxhealth < 0) { g_net.maxhealth = (int)(base_off + (uint32_t)poff); + } else if (strcmp(pname2, "m_hActiveWeapon") == 0 && + g_net.activeweapon < 0) { + g_net.activeweapon = (int)(base_off + (uint32_t)poff); } else if (strcmp(pname2, "m_iTeamNum") == 0 && g_net.teamnum < 0) { g_net.teamnum = (int)(base_off + (uint32_t)poff); } else if (strcmp(pname2, "m_vecOrigin") == 0 && g_net.origin < 0) { @@ -269,9 +272,9 @@ void resolve_netvars() { logf("m_vecAbsVelocity unresolved; jumpbug assist disabled"); logf("netvars: flags=%d velocity=%d movetype=%d health=%d maxhealth=%d " "teamnum=%d origin=%d viewoffset=%d mins=%d maxs=%d lifeste=%d " - "modelindex=%d absvelocity=%d", + "modelindex=%d absvelocity=%d activeweapon=%d", g_net.flags, g_net.velocity, g_net.movetype, g_net.health, g_net.maxhealth, g_net.teamnum, g_net.origin, g_net.viewoffset, g_net.mins, g_net.maxs, g_net.lifestate, g_net.modelindex, - g_net.absvelocity); + g_net.absvelocity, g_net.activeweapon); } -- cgit v1.2.3