fix for 4 player support
authorkub <derkub@gmail.com>
Tue, 22 Feb 2022 20:55:19 +0000 (20:55 +0000)
committerkub <derkub@gmail.com>
Tue, 22 Feb 2022 22:28:55 +0000 (22:28 +0000)
menu.c

diff --git a/menu.c b/menu.c
index 3cd69d2..929713d 100644 (file)
--- a/menu.c
+++ b/menu.c
@@ -1320,9 +1320,9 @@ static char *action_binds(int player_idx, int action_mask, int dev_id)
        if (player_idx >= 0) {\r
                can_combo = 0;\r
                type = IN_BINDTYPE_PLAYER12 + (player_idx >> 1);\r
+               if (player_idx & 1)\r
+                       action_mask <<= 16;\r
        }\r
-       if (player_idx & 1)\r
-               action_mask <<= 16;\r
 \r
        if (dev_id >= 0)\r
                dev = dev_last = dev_id;\r
@@ -1459,11 +1459,12 @@ static void key_config_loop(const me_bind_action *opts, int opt_cnt, int player_
 \r
        dev_id = -1; // show all\r
        mask_shift = 0;\r
-       if (player_idx & 1)\r
-               mask_shift = 16;\r
-       bindtype = IN_BINDTYPE_EMU;\r
-       if (player_idx >= 0)\r
-              bindtype = IN_BINDTYPE_PLAYER12 + (player_idx >> 1);\r
+       if (player_idx >= 0) {\r
+               if (player_idx & 1)\r
+                       mask_shift = 16;\r
+               bindtype = IN_BINDTYPE_PLAYER12 + (player_idx >> 1);\r
+       } else\r
+               bindtype = IN_BINDTYPE_EMU;\r
 \r
        for (;;)\r
        {\r