linux/SDL_syshaptic.c:SDL_SYS_HapticStopAll(): Fix return on error
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled

(cherry picked from commit 43f3991398)
This commit is contained in:
Petar Popovic
2025-08-09 18:00:04 +02:00
committed by Sam Lantinga
parent 68e0108b1c
commit 15cc0f5f91
+2 -3
View File
@@ -1117,13 +1117,12 @@ bool SDL_SYS_HapticResume(SDL_Haptic *haptic)
*/
bool SDL_SYS_HapticStopAll(SDL_Haptic *haptic)
{
int i, ret;
int i;
// Linux does not support this natively so we have to loop.
for (i = 0; i < haptic->neffects; i++) {
if (haptic->effects[i].hweffect != NULL) {
ret = SDL_SYS_HapticStopEffect(haptic, &haptic->effects[i]);
if (ret < 0) {
if (!SDL_SYS_HapticStopEffect(haptic, &haptic->effects[i])) {
return SDL_SetError("Haptic: Error while trying to stop all playing effects.");
}
}