From d4a57fc8338a15b5e6bc9ff20cb754e8201d03e5 Mon Sep 17 00:00:00 2001 From: auria Date: Sat, 3 Dec 2011 02:43:03 +0000 Subject: [PATCH] Try to prevent configuring a gamepad by pressing on the wrong gamepad git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10307 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/states_screens/options_screen_input2.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/states_screens/options_screen_input2.cpp b/src/states_screens/options_screen_input2.cpp index ea389fdae..949743790 100644 --- a/src/states_screens/options_screen_input2.cpp +++ b/src/states_screens/options_screen_input2.cpp @@ -381,13 +381,18 @@ void OptionsScreenInput2::gotSensedInput(const Input& sensed_input) } } - GamepadConfig* config = (GamepadConfig*)m_config; - config->setBinding(binding_to_set, sensed_input.m_type, - sensed_input.m_button_id, - (Input::AxisDirection)sensed_input.m_axis_direction); - // refresh display - updateInputButtons(); + std::string gamepad_name = input_manager->getDeviceList()->getGamePadFromIrrID(sensed_input.m_device_id)->m_name; + if (m_config->getName() == gamepad_name) + { + GamepadConfig* config = (GamepadConfig*)m_config; + config->setBinding(binding_to_set, sensed_input.m_type, + sensed_input.m_button_id, + (Input::AxisDirection)sensed_input.m_axis_direction); + + // refresh display + updateInputButtons(); + } } else {