From 9a98e4b6472aed466ef76a53f1698d2818d0a1ef Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 11 Oct 2018 15:14:48 -0700 Subject: [PATCH] Allow Android haptics to work when SDL is reinitialized (thanks Rachel!) --- src/haptic/android/SDL_syshaptic.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/haptic/android/SDL_syshaptic.c b/src/haptic/android/SDL_syshaptic.c index 5dd15526b12e6..391b7b5d5bab7 100644 --- a/src/haptic/android/SDL_syshaptic.c +++ b/src/haptic/android/SDL_syshaptic.c @@ -195,6 +195,10 @@ SDL_SYS_HapticClose(SDL_Haptic * haptic) void SDL_SYS_HapticQuit(void) { +/* We don't have any way to scan for joysticks (and their vibrators) at init, so don't wipe the list + * of joysticks here in case this is a reinit. + */ +#if 0 SDL_hapticlist_item *item = NULL; SDL_hapticlist_item *next = NULL; @@ -206,6 +210,7 @@ SDL_SYS_HapticQuit(void) SDL_hapticlist = SDL_hapticlist_tail = NULL; numhaptics = 0; return; +#endif }