Fix love.joystick.setGamepadMapping suffix overwriting bug

Previously, if "leftx" was mapped before "x", the latter mapping would overwrite
the former, or in general if any mapping was a suffix of another, it needed to
be mapped first.
This commit is contained in:
Bart van Strien
2015-03-15 15:53:48 +01:00
parent 44b9efb43e
commit 715cab4f6f
+1 -1
View File
@@ -241,7 +241,7 @@ bool JoystickModule::setGamepadMapping(const std::string &guid, Joystick::Gamepa
std::string insertstr = gpinputname + ":" + joyinputstr + ",";
// We should replace any existing gamepad bind.
size_t findpos = mapstr.find(gpinputname + ":");
size_t findpos = mapstr.find(std::string(", ") + gpinputname + ":");
if (findpos != std::string::npos)
{
// The bind string ends at the next comma, or the end of the string.