diff options
| author | salmonik <salmonik@tuta.io> | 2026-10-26 18:26:43 +0100 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-10-26 18:26:43 +0100 |
| commit | 5d299317326dd102a3ffadc9fcfd870f0efe20f8 (patch) | |
| tree | 8faf4c5efb971db91a45282b90ebbbd6a285bad1 /src | |
| parent | Docs/cleanup: refresh CONTEXT, update ISurface status, remove dead code (diff) | |
| download | hl2h-5d299317326dd102a3ffadc9fcfd870f0efe20f8.tar.gz hl2h-5d299317326dd102a3ffadc9fcfd870f0efe20f8.zip | |
Binds: allow multiple features to share the same key
Diffstat (limited to '')
| -rw-r--r-- | src/menu.cpp | 11 |
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(); |
