added support for keys 1 to 4 to select network player in request dialog
authorHolger Schemel <info@artsoft.org>
Wed, 6 Jun 2018 21:07:18 +0000 (23:07 +0200)
committerHolger Schemel <info@artsoft.org>
Mon, 18 Jun 2018 17:47:32 +0000 (19:47 +0200)
src/tools.c

index 24fecfb31d478829d2f89bf2e59fa93a93a8e812..5c259419dc967e6c4d54dc43c52c186dbf1e6f33 100644 (file)
@@ -4215,7 +4215,29 @@ static int RequestHandleEvents(unsigned int req_state)
            }
 
            if (req_state & REQ_PLAYER)
-             result = 0;
+           {
+             int old_player_nr = setup.network_player_nr;
+
+             if (result != -1)
+               result = old_player_nr + 1;
+
+             switch (key)
+             {
+               case KSYM_space:
+                 result = old_player_nr + 1;
+                 break;
+
+               case KSYM_1:
+               case KSYM_2:
+               case KSYM_3:
+               case KSYM_4:
+                 result = key - KSYM_1 + 1;
+                 break;
+
+               default:
+                 break;
+             }
+           }
 
            break;
          }