From 6e92dddd9555ff42b30478518a060ab53b055922 Mon Sep 17 00:00:00 2001 From: e7d Date: Sun, 14 May 2017 15:20:38 +0200 Subject: [PATCH] fixed gamepad template color index determination from name --- js/gamepad.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/gamepad.js b/js/gamepad.js index aa525ff..7b6c5a3 100644 --- a/js/gamepad.js +++ b/js/gamepad.js @@ -384,8 +384,8 @@ class Gamepad { // the color is a string, load it by its name this.activeGamepadColorName = gamepadColor; this.activeGamepadColorIndex = 0; - for (let gamepadColorName in this.activeGamepadIdentifier.colors) { - if (this.activeGamepadColorName === gamepadColorName) { + for (let gamepadColorIndex in this.activeGamepadIdentifier.colors) { + if (this.activeGamepadColorName === this.activeGamepadIdentifier.colors[gamepadColorIndex]) { break; } this.activeGamepadColorIndex++;