From b2c18e9dcd5c7dad7ab8c8da99095050523699c9 Mon Sep 17 00:00:00 2001
From: Kevin Andersen <k.andersen@lego.com>
Date: Tue, 9 Apr 2019 15:34:08 -0400
Subject: [PATCH] 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

---
 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 186377599..a519f8a05 100644
--- a/src/extensions/scratch3_boost/index.js
+++ b/src/extensions/scratch3_boost/index.js
@@ -372,9 +372,11 @@ class BoostMotor {
          * Scale the motor power to a range between 10 and 100,
          * to make sure the motors will run with something built onto them.
          */
-        const p = MathUtil.scale(value, 0, 100, 10, 100);
-        
-        this._power = p;
+        if (value === 0) {
+            this._power = 0;
+        } else {
+            this._power = MathUtil.scale(value, 1, 100, 10, 100);
+        }
     }
 
     /**