From b9271ed25aa36723d692cdce00ab44f17ceafac7 Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Mon, 3 Nov 2014 16:19:47 -0400 Subject: [PATCH] Don't throw an error if the mappings passed to love.joystick.loadGamepadMappings contain mappings for other platforms but no mappings for the currently running platform. --- src/modules/joystick/sdl/JoystickModule.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/modules/joystick/sdl/JoystickModule.cpp b/src/modules/joystick/sdl/JoystickModule.cpp index a6af78703..87435b266 100644 --- a/src/modules/joystick/sdl/JoystickModule.cpp +++ b/src/modules/joystick/sdl/JoystickModule.cpp @@ -499,7 +499,11 @@ void JoystickModule::loadGamepadMappings(const std::string &mappings) std::string platform = mapping.substr(pstartpos, pendpos - pstartpos); if (platform.compare(SDL_GetPlatform()) != 0) + { + // Ignore the mapping but still acknowledge that it is one. + success = true; continue; + } pstartpos -= strlen("platform:"); mapping.erase(pstartpos, pendpos - pstartpos + 1);