summaryrefslogtreecommitdiffstats
path: root/src/hl2h.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/hl2h.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 'src/hl2h.cpp')
-rw-r--r--src/hl2h.cpp42
1 files changed, 22 insertions, 20 deletions
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) {
500 if (jumpbug_apply(cmd, localIdx, ent, flags, vel, frametime)) 500 if (jumpbug_apply(cmd, localIdx, ent, flags, vel, frametime))
501 note_modified(cmd, flags, vel); 501 note_modified(cmd, flags, vel);
502 502
503 if (!feature_active(FEAT_AIMBOT) || !feature_has_bind(FEAT_AIMBOT)) 503 bool melee = feature_active(FEAT_MELEE) && melee_weapon_active(ent);
504
505 if (!feature_active(FEAT_AIMBOT) || !feature_has_bind(FEAT_AIMBOT) || melee)
504 aimbot_reset_lock(); 506 aimbot_reset_lock();
505 if (!feature_active(FEAT_SILENTAIM) || !feature_has_bind(FEAT_SILENTAIM)) 507 if (!feature_active(FEAT_SILENTAIM) || !feature_has_bind(FEAT_SILENTAIM) ||
508 melee)
506 silentaim_reset_lock(); 509 silentaim_reset_lock();
507 510
508 if (feature_active(FEAT_AIMBOT)) { 511 if (melee) {
509 static bool aim_feature_logged = false; 512 if (melee_aimbot_apply(cmd))
510 if (!aim_feature_logged) {
511 aim_feature_logged = true;
512 logf("aimbot: feature active (bind held)");
513 }
514 if (aimbot_apply(cmd)) {
515 const float *vel = (const float *)(e + g_net.velocity);
516 note_modified(cmd, flags, vel); 513 note_modified(cmd, flags, vel);
514 } else {
515 if (feature_active(FEAT_AIMBOT)) {
516 static bool aim_feature_logged = false;
517 if (!aim_feature_logged) {
518 aim_feature_logged = true;
519 logf("aimbot: feature active (bind held)");
520 }
521 if (aimbot_apply(cmd))
522 note_modified(cmd, flags, vel);
517 } 523 }
518 }
519 524
520 if (feature_active(FEAT_TRIGGERBOT)) { 525 if (feature_active(FEAT_TRIGGERBOT)) {
521 if (triggerbot_apply(cmd)) { 526 if (triggerbot_apply(cmd))
522 const float *vel = (const float *)(e + g_net.velocity); 527 note_modified(cmd, flags, vel);
523 note_modified(cmd, flags, vel);
524 } 528 }
525 }
526 529
527 if (feature_active(FEAT_SILENTAIM)) { 530 if (feature_active(FEAT_SILENTAIM)) {
528 if (silent_aim_apply(cmd)) { 531 if (silent_aim_apply(cmd))
529 const float *vel = (const float *)(e + g_net.velocity); 532 note_modified(cmd, flags, vel);
530 note_modified(cmd, flags, vel);
531 } 533 }
532 } 534 }
533} 535}