From: Michal MalĂ˝ Date: Sat, 1 Aug 2015 14:48:34 +0000 (+0200) Subject: Initialize repeat value correctly X-Git-Url: https://gitweb.devoid-pointer.net/?a=commitdiff_plain;h=45673d18d969c784b2d81230233a6fb4ec676e46;p=FFBChecker.git Initialize repeat value correctly --- 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()));