Merge pull request #501 from Hasufel/patch-1

Guard against doppleganger gamepad connection
This commit is contained in:
Joshua Granick
2015-07-14 22:23:11 -07:00

View File

@@ -144,9 +144,11 @@ class NativeApplication {
case CONNECT:
var gamepad = new Gamepad (gamepadEventInfo.id);
Gamepad.devices.set (gamepadEventInfo.id, gamepad);
parent.window.onGamepadConnect.dispatch (gamepad);
if (!Gamepad.devices.exists(gamepadEventInfo.id)) {
var gamepad = new Gamepad (gamepadEventInfo.id);
Gamepad.devices.set (gamepadEventInfo.id, gamepad);
parent.window.onGamepadConnect.dispatch (gamepad);
}
case DISCONNECT:
@@ -753,4 +755,4 @@ private class WindowEventInfo {
var WINDOW_RESIZE = 9;
var WINDOW_RESTORE = 10;
}
}