From d02a1dd0cb172537c5d602d7f2b6729828741dfc Mon Sep 17 00:00:00 2001 From: Philipp Wiesemann Date: Sat, 27 Jul 2013 13:52:16 +0200 Subject: [PATCH] Fixed SDL_HapticRumblePlay() maybe working because of SDL_HapticUpdateEffect(). --- src/haptic/SDL_haptic.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/haptic/SDL_haptic.c b/src/haptic/SDL_haptic.c index 1c677b14a..2d23e41ed 100644 --- a/src/haptic/SDL_haptic.c +++ b/src/haptic/SDL_haptic.c @@ -781,7 +781,6 @@ SDL_HapticRumbleInit(SDL_Haptic * haptic) int SDL_HapticRumblePlay(SDL_Haptic * haptic, float strength, Uint32 length) { - int ret; SDL_HapticPeriodic *efx; if (!ValidHaptic(haptic)) { @@ -804,9 +803,8 @@ SDL_HapticRumblePlay(SDL_Haptic * haptic, float strength, Uint32 length) efx = &haptic->rumble_effect.periodic; efx->magnitude = (Sint16)(32767.0f*strength); efx->length = length; - ret = SDL_HapticUpdateEffect(haptic, haptic->rumble_id, &haptic->rumble_effect); - if (ret) { - return ret; + if (SDL_HapticUpdateEffect(haptic, haptic->rumble_id, &haptic->rumble_effect) < 0) { + return -1; } return SDL_HapticRunEffect(haptic, haptic->rumble_id, 1);