From 270a445703c7c803f6314dabc89d276ccddb2aa5 Mon Sep 17 00:00:00 2001 From: Evelyn Eastmond Date: Fri, 26 Apr 2019 16:35:43 -0400 Subject: [PATCH] Playing with power states while we figure out the design. --- src/extensions/scratch3_boost/index.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/extensions/scratch3_boost/index.js b/src/extensions/scratch3_boost/index.js index db8d8e4ab..4e3e4f5c8 100644 --- a/src/extensions/scratch3_boost/index.js +++ b/src/extensions/scratch3_boost/index.js @@ -510,7 +510,9 @@ class BoostMotor { * @param {boolean} [resetState=true] - whether to reset the state of the motor when running this command. */ turnOnFor (milliseconds, resetState = true) { - if (this.power === 0) return; + if (this.power === 0) { + this.turnOff(false); + } milliseconds = Math.max(0, milliseconds); if (resetState) this.status = BoostMotorState.ON_FOR_TIME; @@ -525,10 +527,10 @@ class BoostMotor { * @param {boolean} [resetState=true] - whether to reset the state of the motor when running this command. */ turnOnForDegrees (degrees, direction, resetState = true) { - if (this.power === 0) { + /* if (this.power === 0) { this._clearRotationState(); return; - } + }*/ degrees = Math.max(0, degrees);