Browse Source

Ignore lines starting with "#" when parsing the mappings string given to love.joystick.loadGamepadMappings.

Alex Szpakowski 10 years ago
parent
commit
195d41d1d9
1 changed files with 4 additions and 0 deletions
  1. 4 0
      src/modules/joystick/sdl/JoystickModule.cpp

+ 4 - 0
src/modules/joystick/sdl/JoystickModule.cpp

@@ -489,6 +489,10 @@ void JoystickModule::loadGamepadMappings(const std::string &mappings)
 		if (mapping.empty())
 			continue;
 
+		// Lines starting with "#" are comments.
+		if (mapping[0] == '#')
+			continue;
+
 		// Strip out and compare any "platform:XYZ," in the mapping.
 		size_t pstartpos = mapping.find("platform:");
 		if (pstartpos != std::string::npos)