Moved a SDL_SetError() call elsewhere to avoid triggering it needlessly.
authorRyan C. Gordon <icculus@icculus.org>
Wed, 23 Oct 2013 15:54:12 -0400
changeset 7884 15027aa2cf21
parent 7883 62f562a475e1
child 7885 a8bd63b33636
Moved a SDL_SetError() call elsewhere to avoid triggering it needlessly. Otherwise, the XInput path would always trigger it in a harmless manner.
src/haptic/windows/SDL_syshaptic.c
--- a/src/haptic/windows/SDL_syshaptic.c	Wed Oct 23 00:58:20 2013 -0400
+++ b/src/haptic/windows/SDL_syshaptic.c	Wed Oct 23 15:54:12 2013 -0400
@@ -1190,7 +1190,6 @@
         return &GUID_CustomForce;
 
     default:
-        SDL_SetError("Haptic: Unknown effect type.");
         return NULL;
     }
 }
@@ -1207,6 +1206,7 @@
     REFGUID type = SDL_SYS_HapticEffectType(base);
 
     if ((type == NULL) && (!haptic->hwdata->bXInputHaptic)) {
+        SDL_SetError("Haptic: Unknown effect type.");
         goto err_hweffect;
     }