From c665fcb2ed2705d017bd6dcaef7f405a836c9ce5 Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Sat, 30 May 2020 22:20:45 +0300 Subject: [PATCH] Minor fixes --- JoyKit/JOYController.m | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/JoyKit/JOYController.m b/JoyKit/JOYController.m index 96de291..b815ddb 100644 --- a/JoyKit/JOYController.m +++ b/JoyKit/JOYController.m @@ -697,6 +697,8 @@ typedef union { } _physicallyConnected = false; [exposedControllers removeObject:self]; + [self setRumbleAmplitude:0]; + [self updateRumble]; _device = nil; } @@ -734,6 +736,9 @@ typedef union { if (!self.connected) { return; } + if (!_rumbleElement && !_isSwitch && !_isDualShock3) { + return; + } if (_rumbleElement.max == 1 && _rumbleElement.min == 0) { double ampToSend = _rumbleCounter < round(_rumbleAmplitude * PWM_RESOLUTION); if (ampToSend != _sentRumbleAmp) {