summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-10-26 18:26:43 +0100
committersalmonik <salmonik@tuta.io>2026-10-26 18:26:43 +0100
commit5d299317326dd102a3ffadc9fcfd870f0efe20f8 (patch)
tree8faf4c5efb971db91a45282b90ebbbd6a285bad1
parentDocs/cleanup: refresh CONTEXT, update ISurface status, remove dead code (diff)
downloadhl2h-5d299317326dd102a3ffadc9fcfd870f0efe20f8.tar.gz
hl2h-5d299317326dd102a3ffadc9fcfd870f0efe20f8.zip
Binds: allow multiple features to share the same key
-rw-r--r--src/menu.cpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/menu.cpp b/src/menu.cpp
index d628873..9537e05 100644
--- a/src/menu.cpp
+++ b/src/menu.cpp
@@ -503,17 +503,10 @@ static void menu_handle_input() {
503 g_bind_mode = false; 503 g_bind_mode = false;
504 return; // cancel, keep old bind 504 return; // cancel, keep old bind
505 } 505 }
506 // any other key = new bind 506 // any other key = new bind (features may share the same bind)
507 MenuNode *n = g_visible[g_selected]; 507 MenuNode *n = g_visible[g_selected];
508 if (n->bind_ptr) { 508 if (n->bind_ptr)
509 // clear same bind from other features
510 FeatureState *features[] = {&g_bhop, &g_abh, &g_aimbot, &g_triggerbot,
511 &g_silentaim};
512 for (auto *f : features)
513 if (&f->bind != n->bind_ptr && f->bind == i)
514 f->bind = 0;
515 *n->bind_ptr = i; 509 *n->bind_ptr = i;
516 }
517 g_bind_mode = false; 510 g_bind_mode = false;
518 config_save(); 511 config_save();
519 rebuild_visible(); 512 rebuild_visible();