Skip to content

Commit

Permalink
Check if component supports select first
Browse files Browse the repository at this point in the history
This prevents a deadlock when keybinding when the user tries to bind to
up/down and that key is already bound.
  • Loading branch information
Vagabond authored and mrannanj committed Jun 30, 2024
1 parent 38310d9 commit d8f2076
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/game/gui/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ static int menu_action(component *mc, int action) {

// Handle down/up selection movement
c = sizer_get(mc, m->selected);
if(c != NULL && (action == ACT_DOWN || action == ACT_UP)) {
if(c != NULL && c->supports_select && (action == ACT_DOWN || action == ACT_UP)) {
component_select(c, 0);
do {
if(action == ACT_DOWN) {
Expand Down

0 comments on commit d8f2076

Please sign in to comment.