BoostMotor.power(value) now sets to 0 if value is 0 rather than scaling, to ensure that blocks skip immediately if speed set to 0

This commit is contained in:
Kevin Andersen 2019-04-09 15:34:08 -04:00
parent 75fc37aa30
commit b2c18e9dcd

View file

@ -372,9 +372,11 @@ class BoostMotor {
* Scale the motor power to a range between 10 and 100, * Scale the motor power to a range between 10 and 100,
* to make sure the motors will run with something built onto them. * to make sure the motors will run with something built onto them.
*/ */
const p = MathUtil.scale(value, 0, 100, 10, 100); if (value === 0) {
this._power = 0;
this._power = p; } else {
this._power = MathUtil.scale(value, 1, 100, 10, 100);
}
} }
/** /**