Fixed love.joystick.loadGamepadMappings to properly enable currently connected Joysticks as Gamepads when necessary.

This commit is contained in:
Alex Szpakowski
2014-06-04 16:03:02 -03:00
parent 79b453653a
commit 42a565a0eb
2 changed files with 13 additions and 2 deletions
@@ -496,6 +496,14 @@ void JoystickModule::loadGamepadMappings(const std::string &mappings)
}
success = success || (SDL_GameControllerAddMapping(mapping.c_str()) != -1);
if (success)
{
// FIXME: massive hack until missing APIs are added to SDL 2:
// https://bugzilla.libsdl.org/show_bug.cgi?id=1975
std::string guid = mapping.substr(0, mapping.find_first_of(','));
checkGamepads(guid);
}
}
if (!success)