From 39e24fe5842b5feaa65e6d0bcc5a868ccafee713 Mon Sep 17 00:00:00 2001 From: sonninnos Date: Sat, 20 Mar 2021 01:06:45 +0200 Subject: [PATCH] New bind order scan/clear fix --- menu/cbs/menu_cbs_scan.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/menu/cbs/menu_cbs_scan.c b/menu/cbs/menu_cbs_scan.c index 0e1948a65f..ed7b65ac9e 100644 --- a/menu/cbs/menu_cbs_scan.c +++ b/menu/cbs/menu_cbs_scan.c @@ -171,7 +171,8 @@ static int action_scan_input_desc(const char *path, /* Skip 'Device Type' and 'Analog to Digital Type' */ key = (unsigned)(idx - 2); /* Select the reorderer bind */ - key = input_config_bind_order[key]; + key = + (key < RARCH_ANALOG_BIND_LIST_END) ? input_config_bind_order[key] : key; if (type >= MENU_SETTINGS_INPUT_DESC_BEGIN && type <= MENU_SETTINGS_INPUT_DESC_END) @@ -191,6 +192,9 @@ static int action_scan_input_desc(const char *path, /* This hardcoded value may cause issues if any entries are added on top of the input binds */ key = (unsigned)(idx - 7); + /* Select the reorderer bind */ + key = + (key < RARCH_ANALOG_BIND_LIST_END) ? input_config_bind_order[key] : key; } else key = input_config_translate_str_to_bind_id(label);