diff --git a/engine/client/in_generic.c b/engine/client/in_generic.c index 6058c9748..fd6f1ae7c 100644 --- a/engine/client/in_generic.c +++ b/engine/client/in_generic.c @@ -151,6 +151,8 @@ void joy_radialdeadzone_cb(cvar_t *var, char *oldvalue) #endif static cvar_t joy_radialdeadzone = CVARCD("joyradialdeadzone", "", joy_radialdeadzone_cb, "Treat controller dead zones as a pair, rather than per-axis."); +cvar_t in_skipplayerone = CVARD("in_skipplayerone", "1", "Do not auto-assign joysticks/game-controllers to the first player. Requires in_restart to take effect."); //FIXME: this needs to be able to change deviceids when changed. until then menus will need to in_restart. + #define EVENTQUEUELENGTH 1024 static struct eventlist_s @@ -380,6 +382,7 @@ void IN_Init(void) } Cvar_Register (&joy_exponent, "input controls"); Cvar_Register (&joy_radialdeadzone, "input controls"); + Cvar_Register (&in_skipplayerone, "input controls"); Cmd_AddCommand ("in_deviceids", IN_DeviceIDs_f); diff --git a/engine/client/in_sdl.c b/engine/client/in_sdl.c index c2f52ef3e..617d6ce30 100644 --- a/engine/client/in_sdl.c +++ b/engine/client/in_sdl.c @@ -162,7 +162,8 @@ static cvar_t joy_only = CVARD("joyonly", "0", "If true, treats \"game controlle //the enumid is the value for the open function rather than the working id. static void J_AllocateDevID(struct sdljoy_s *joy) { - unsigned int id = 0, j; + extern cvar_t in_skipplayerone; + unsigned int id = (in_skipplayerone.ival?1:0), j; for (j = 0; j < MAX_JOYSTICKS;) { if (sdljoy[j++].qdevid == id) diff --git a/engine/client/in_win.c b/engine/client/in_win.c index 990132df6..1086274f5 100644 --- a/engine/client/in_win.c +++ b/engine/client/in_win.c @@ -447,8 +447,9 @@ static void INS_HideMouse (void) static int Joy_AllocateDevID(void) { extern cvar_t cl_splitscreen; - int id = 0, j; - for (id = 0; ; id++) + extern cvar_t in_skipplayerone; + int id = (in_skipplayerone.ival?1:0), j; + for ( ; ; id++) { for (j = 0; j < joy_count; j++) {