fixed gamepad refresh to be done only if there is an active gamepad

This commit is contained in:
e7d 2017-05-14 11:40:43 +02:00
parent eb2cd58354
commit 0170909afd

View File

@ -215,13 +215,13 @@ class Gamepad {
} }
updateVisualStatus() { updateVisualStatus() {
this.refreshGamepads();
// ensure that a gamepad is currently active // ensure that a gamepad is currently active
if (!this.activeGamepad) { if (!this.activeGamepad) {
return; return;
} }
this.refreshGamepads();
requestAnimationFrame(this.updateVisualStatus.bind(this)); requestAnimationFrame(this.updateVisualStatus.bind(this));
let button; let button;