fixed removeGamepad method

This commit is contained in:
e7d 2017-05-14 11:16:43 +02:00
parent 0a8edf3298
commit 60d0921fc3

View File

@ -105,7 +105,10 @@ class Gamepad {
} }
removeGamepad(gamepadIndex) { removeGamepad(gamepadIndex) {
if (!gamepadIndex || gamepadIndex === this.activeGamepadIndex) { if ('undefined' === typeof gamepadIndex) {
return;
}
if (gamepadIndex === this.activeGamepadIndex) {
this.activeGamepadIndex = null; this.activeGamepadIndex = null;
this.$gamepad.empty(); this.$gamepad.empty();
} }