]> Devoid-pointer.net GitWeb - FFBChecker.git/commitdiff
Initialize repeat value correctly
authorMichal Malý <madcatxster@devoid-pointer.net>
Sat, 1 Aug 2015 14:48:34 +0000 (16:48 +0200)
committerMichal Malý <madcatxster@devoid-pointer.net>
Sat, 1 Aug 2015 14:48:34 +0000 (16:48 +0200)
sdl2ffbdevice.cpp

index 17fbb192d2f6b183449cc599f5b3d4fa2bd075c5..f4b9cc0641788c64f059784928d2934d66c2c114 100644 (file)
@@ -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()));