fixed gamepad template color index determination from name

This commit is contained in:
e7d 2017-05-14 15:20:38 +02:00
parent 11ba1e8fb0
commit 6e92dddd95

View File

@ -384,8 +384,8 @@ class Gamepad {
// the color is a string, load it by its name // the color is a string, load it by its name
this.activeGamepadColorName = gamepadColor; this.activeGamepadColorName = gamepadColor;
this.activeGamepadColorIndex = 0; this.activeGamepadColorIndex = 0;
for (let gamepadColorName in this.activeGamepadIdentifier.colors) { for (let gamepadColorIndex in this.activeGamepadIdentifier.colors) {
if (this.activeGamepadColorName === gamepadColorName) { if (this.activeGamepadColorName === this.activeGamepadIdentifier.colors[gamepadColorIndex]) {
break; break;
} }
this.activeGamepadColorIndex++; this.activeGamepadColorIndex++;