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
This commit is contained in:
auria 2011-12-03 02:43:03 +00:00
parent 150cc190b0
commit d4a57fc833

View File

@ -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
{