From 45673d18d969c784b2d81230233a6fb4ec676e46 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michal=20Mal=C3=BD?= Date: Sat, 1 Aug 2015 16:48:34 +0200 Subject: [PATCH] Initialize repeat value correctly --- sdl2ffbdevice.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sdl2ffbdevice.cpp b/sdl2ffbdevice.cpp index 17fbb19..f4b9cc0 100644 --- a/sdl2ffbdevice.cpp +++ b/sdl2ffbdevice.cpp @@ -138,8 +138,10 @@ bool SDL2FFBDevice::startEffect(const int idx, const FFBEffectTypes type, std::s if (sdlEff->parameters()->repeat == 0) { if (sdlEff->parameters()->replayLength > 0) repeat = SDL_HAPTIC_INFINITY; + else + repeat = 1; } else - repeat = 1; + repeat = sdlEff->parameters()->repeat; if (SDL_HapticRunEffect(c_haptic, sdlEff->internalIdx(), repeat) < 0) { QMessageBox::warning(nullptr, "SDL2 error", QString("Unable to start the effect:\n%1").arg(SDL_GetError())); -- 2.43.5