/* Checks to see if the haptic device is valid  */
static int ValidHaptic(SDL_Haptic *haptic)
/* Checks to see if the haptic device is valid  */
static int ValidHaptic(SDL_Haptic *haptic)
{
    int valid;
    SDL_Haptic *hapticlist;
    valid = 0;
    if (haptic != NULL) {
        hapticlist = SDL_haptics;
        while ( hapticlist )
        {
            if (hapticlist == haptic) {
                valid = 1;
                break;
            }
            hapticlist = hapticlist->next;
        }
    }
    if (valid == 0) {
        SDL_SetError("Haptic: Invalid haptic device identifier");
    }
    return valid;
}