Fix in_availableJoysticks cvar not updating

When in_restart is called or SDL controller added/remove event is
received, IN_InitJoystick() tried to update the list but instead
of updating the cvar Cvar_Get() just printed a developer message:

  Warning: cvar "in_availableJoysticks" given initial values:
  "first joystick
  ", "first joystick
  second joystick
  "
This commit is contained in:
Zack Middleton 2022-09-22 10:17:09 -05:00
parent f92c293f7b
commit 84da6537c4

View file

@ -503,7 +503,10 @@ static void IN_InitJoystick( void )
Q_strcat(buf, sizeof(buf), "\n"); Q_strcat(buf, sizeof(buf), "\n");
} }
Cvar_Get( "in_availableJoysticks", buf, CVAR_ROM ); Cvar_Get( "in_availableJoysticks", "", CVAR_ROM );
// Update cvar on in_restart or controller add/remove.
Cvar_Set( "in_availableJoysticks", buf );
if( !in_joystick->integer ) { if( !in_joystick->integer ) {
Com_DPrintf( "Joystick is not active.\n" ); Com_DPrintf( "Joystick is not active.\n" );