Don't process further when vibration intensity is 0

This commit is contained in:
redphx 2024-06-01 18:37:06 +07:00
parent ddc4346da8
commit db78918d34

View File

@ -3,6 +3,10 @@ if (!window.BX_ENABLE_CONTROLLER_VIBRATION) {
}
const intensity = window.BX_VIBRATION_INTENSITY;
if (intensity === 0) {
return void(0);
}
if (intensity < 1) {
e.leftMotorPercent *= intensity;
e.rightMotorPercent *= intensity;