瀏覽代碼

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.

Alex Szpakowski 11 年之前
父節點
當前提交
b9271ed25a
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      src/modules/joystick/sdl/JoystickModule.cpp

+ 4 - 0
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);
 			std::string platform = mapping.substr(pstartpos, pendpos - pstartpos);
 
 
 			if (platform.compare(SDL_GetPlatform()) != 0)
 			if (platform.compare(SDL_GetPlatform()) != 0)
+			{
+				// Ignore the mapping but still acknowledge that it is one.
+				success = true;
 				continue;
 				continue;
+			}
 
 
 			pstartpos -= strlen("platform:");
 			pstartpos -= strlen("platform:");
 			mapping.erase(pstartpos, pendpos - pstartpos + 1);
 			mapping.erase(pstartpos, pendpos - pstartpos + 1);