From 468887a6f97c08137784443bd5841ec826e793ba Mon Sep 17 00:00:00 2001 From: Garrett Date: Fri, 28 Aug 2020 23:36:56 -0400 Subject: [PATCH] Check for zero rumble setting before allowing rumble Fixes controllers which don't check for rumble_strength and have constant rumble from rumbling even when set to 0 in the config. --- src/pc/controller/controller_entry_point.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/pc/controller/controller_entry_point.c b/src/pc/controller/controller_entry_point.c index d5403f93..bc5e9fe6 100644 --- a/src/pc/controller/controller_entry_point.c +++ b/src/pc/controller/controller_entry_point.c @@ -33,12 +33,16 @@ s32 osContInit(UNUSED OSMesgQueue *mq, u8 *controllerBits, UNUSED OSContStatus * s32 osMotorStart(UNUSED void *pfs) { // Since rumble stops by osMotorStop, its duration is not nessecary. // Set it to 5 seconds and hope osMotorStop() is called in time. - controller_rumble_play(configRumbleStrength / 100.0f, 5.0f); + if (configRumbleStrength>0){ + controller_rumble_play(configRumbleStrength / 100.0f, 5.0f); + } return 0; } s32 osMotorStop(UNUSED void *pfs) { - controller_rumble_stop(); + if (configRumbleStrength>0){ + controller_rumble_stop(); + } return 0; }