summaryrefslogtreecommitdiffstats
path: root/src/netvars.cpp
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-10-27 14:52:00 +0100
committersalmonik <salmonik@tuta.io>2026-10-27 14:52:24 +0100
commit293eda2bdce9d732fad168b5b6838bd89ce59fe8 (patch)
tree9f345d4a19d1957ccfd7764012221d62eb2df328 /src/netvars.cpp
parentMenu: latch the Insert key and expand the root on open (diff)
downloadhl2h-293eda2bdce9d732fad168b5b6838bd89ce59fe8.tar.gz
hl2h-293eda2bdce9d732fad168b5b6838bd89ce59fe8.zip
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=...
Diffstat (limited to '')
-rw-r--r--src/netvars.cpp7
1 files changed, 5 insertions, 2 deletions
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) {
89 g_net.health = (int)(base_off + (uint32_t)poff); 89 g_net.health = (int)(base_off + (uint32_t)poff);
90 } else if (strcmp(pname2, "m_iMaxHealth") == 0 && g_net.maxhealth < 0) { 90 } else if (strcmp(pname2, "m_iMaxHealth") == 0 && g_net.maxhealth < 0) {
91 g_net.maxhealth = (int)(base_off + (uint32_t)poff); 91 g_net.maxhealth = (int)(base_off + (uint32_t)poff);
92 } else if (strcmp(pname2, "m_hActiveWeapon") == 0 &&
93 g_net.activeweapon < 0) {
94 g_net.activeweapon = (int)(base_off + (uint32_t)poff);
92 } else if (strcmp(pname2, "m_iTeamNum") == 0 && g_net.teamnum < 0) { 95 } else if (strcmp(pname2, "m_iTeamNum") == 0 && g_net.teamnum < 0) {
93 g_net.teamnum = (int)(base_off + (uint32_t)poff); 96 g_net.teamnum = (int)(base_off + (uint32_t)poff);
94 } else if (strcmp(pname2, "m_vecOrigin") == 0 && g_net.origin < 0) { 97 } else if (strcmp(pname2, "m_vecOrigin") == 0 && g_net.origin < 0) {
@@ -269,9 +272,9 @@ void resolve_netvars() {
269 logf("m_vecAbsVelocity unresolved; jumpbug assist disabled"); 272 logf("m_vecAbsVelocity unresolved; jumpbug assist disabled");
270 logf("netvars: flags=%d velocity=%d movetype=%d health=%d maxhealth=%d " 273 logf("netvars: flags=%d velocity=%d movetype=%d health=%d maxhealth=%d "
271 "teamnum=%d origin=%d viewoffset=%d mins=%d maxs=%d lifeste=%d " 274 "teamnum=%d origin=%d viewoffset=%d mins=%d maxs=%d lifeste=%d "
272 "modelindex=%d absvelocity=%d", 275 "modelindex=%d absvelocity=%d activeweapon=%d",
273 g_net.flags, g_net.velocity, g_net.movetype, g_net.health, 276 g_net.flags, g_net.velocity, g_net.movetype, g_net.health,
274 g_net.maxhealth, g_net.teamnum, g_net.origin, g_net.viewoffset, 277 g_net.maxhealth, g_net.teamnum, g_net.origin, g_net.viewoffset,
275 g_net.mins, g_net.maxs, g_net.lifestate, g_net.modelindex, 278 g_net.mins, g_net.maxs, g_net.lifestate, g_net.modelindex,
276 g_net.absvelocity); 279 g_net.absvelocity, g_net.activeweapon);
277} 280}