Skip to content

Commit

Permalink
Fixed goofy logic in haptic device comparison code.
Browse files Browse the repository at this point in the history
Mitchell Keith Bloch did the research on this bug, and came up with a slightly
 different patch than this.

Partially fixes Bugzilla #2126.
  • Loading branch information
icculus committed Oct 20, 2013
1 parent 54dce3f commit 6e1169d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/haptic/windows/SDL_syshaptic.c
Expand Up @@ -636,9 +636,11 @@ SDL_SYS_JoystickIsHaptic(SDL_Joystick * joystick)
int
SDL_SYS_JoystickSameHaptic(SDL_Haptic * haptic, SDL_Joystick * joystick)
{
if ((joystick->hwdata->bXInputHaptic == haptic->hwdata->bXInputHaptic) && (haptic->hwdata->userid == joystick->hwdata->userid)) {
return 1;
} else {
if ((joystick->hwdata->bXInputHaptic != haptic->hwdata->bXInputHaptic) {
return 0; /* one is XInput, one is not; not the same device. */
} else if (joystick->hwdata->bXInputHaptic) { /* XInput */
return (haptic->hwdata->userid == joystick->hwdata->userid);
} else { /* DirectInput */
HRESULT ret;
DIDEVICEINSTANCE hap_instance, joy_instance;

Expand Down

0 comments on commit 6e1169d

Please sign in to comment.