mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 06:52:40 -05:00
Simplified the return value for when power is 0 in motorOnForRotation()
This commit is contained in:
parent
a98f3af2e1
commit
12e969119a
1 changed files with 1 additions and 1 deletions
|
@ -1696,7 +1696,7 @@ class Scratch3BoostBlocks {
|
|||
const motor = this._peripheral.motor(portID);
|
||||
if (motor) {
|
||||
// to avoid a hanging block if power is 0, return an immediately resolving promise.
|
||||
if (motor.power === 0) return new Promise(resolve => resolve());
|
||||
if (motor.power === 0) return Promise.resolve();
|
||||
return new Promise(resolve => {
|
||||
motor.turnOnForDegrees(degrees, sign);
|
||||
motor.pendingPromiseFunction = resolve;
|
||||
|
|
Loading…
Reference in a new issue