From 7bc5c9e382f2be797a9b5c9f64d61c8abb55e616 Mon Sep 17 00:00:00 2001 From: IntellectualKitty Date: Wed, 27 Apr 2016 06:04:16 -0600 Subject: [PATCH] Error checking for pre-existing joystick in matchCallback in cocoa_joystick.m The matchCallback function has an initial loop to filter out redundant joystick additions based on matching deviceRef values. However, the if statement incorrectly combines this test with the condition that the joystick is not present, which is obviously incorrect. --- src/cocoa_joystick.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cocoa_joystick.m b/src/cocoa_joystick.m index 0e0a20f5b..674004235 100644 --- a/src/cocoa_joystick.m +++ b/src/cocoa_joystick.m @@ -276,7 +276,7 @@ static void matchCallback(void* context, for (joy = GLFW_JOYSTICK_1; joy <= GLFW_JOYSTICK_LAST; joy++) { - if (!_glfw.ns_js.js[joy].present && _glfw.ns_js.js[joy].deviceRef == deviceRef) + if (_glfw.ns_js.js[joy].present && _glfw.ns_js.js[joy].deviceRef == deviceRef) return; }