Skip to content

Commit

Permalink
In Input Settings, match the joystick device based on index.
Browse files Browse the repository at this point in the history
This can end up selecting a different joystick than the user had
selected if the order of connected joysticks change. However, this
matches the logic in SDLJoystick , so it's at least consistent now.
  • Loading branch information
blast007 committed Aug 8, 2023
1 parent a6cded9 commit 84148a0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/bzflag/InputMenu.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ InputMenu::InputMenu() : keyboardMapMenu(nullptr), joystickTestMenu(nullptr)
joystickDevices.erase(joystickDevices.begin(), joystickDevices.end());
for (i = 0; i < (int)options->size(); i++)
{
if ((*options)[i].compare(currentJoystickDevice) == 0)
if ((*options)[i].compare(0, 1, currentJoystickDevice, 0, 1) == 0)
{
option->setIndex(i);
break;
Expand Down

0 comments on commit 84148a0

Please sign in to comment.