# HG changeset patch # User Edgar Simo # Date 1219599682 0 # Node ID e871cff1e3d25b72903e2be2a86fc6705e07830e # Parent 9408be170bff93933630434a0bcb19674b9ea961 Fixed linux implementation of SDL_HapticStopAll. diff -r 9408be170bff -r e871cff1e3d2 src/haptic/linux/SDL_syshaptic.c --- a/src/haptic/linux/SDL_syshaptic.c Sun Aug 24 17:32:50 2008 +0000 +++ b/src/haptic/linux/SDL_syshaptic.c Sun Aug 24 17:41:22 2008 +0000 @@ -916,16 +916,18 @@ int SDL_SYS_HapticStopAll(SDL_Haptic * haptic) { - int i, ret;; + int i, ret; + /* Linux does not support this natively so we have to loop. */ for (i=0; ineffects; i++) { - ret = SDL_SYS_HapticStopEffect(haptic, &haptic->effects[i]); - if (ret < 0) { - SDL_SetError("Haptic: Error while trying to stop all playing effects."); - return -1; + if (haptic->effects[i].hweffect != NULL) { + ret = SDL_SYS_HapticStopEffect(haptic, &haptic->effects[i]); + if (ret < 0) { + SDL_SetError("Haptic: Error while trying to stop all playing effects."); + return -1; + } } } - return 0; }