mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 23:12:24 -05:00
Merge pull request #2115 from knandersen/bugfix/2108
Fix #2108 by making setMotorPower() and setMotorDirection() yield for a tick
This commit is contained in:
commit
1c8dfea382
1 changed files with 4 additions and 0 deletions
|
@ -1756,6 +1756,7 @@ class Scratch3BoostBlocks {
|
||||||
* @param {object} args - the block's arguments.
|
* @param {object} args - the block's arguments.
|
||||||
* @property {MotorID} MOTOR_ID - the motor(s) to be affected.
|
* @property {MotorID} MOTOR_ID - the motor(s) to be affected.
|
||||||
* @property {int} POWER - the new power level for the motor(s).
|
* @property {int} POWER - the new power level for the motor(s).
|
||||||
|
* @return {Promise} - returns a promise to make sure the block yields.
|
||||||
*/
|
*/
|
||||||
setMotorPower (args) {
|
setMotorPower (args) {
|
||||||
// TODO: cast args.MOTOR_ID?
|
// TODO: cast args.MOTOR_ID?
|
||||||
|
@ -1778,6 +1779,7 @@ class Scratch3BoostBlocks {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
return Promise.resolve();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1786,6 +1788,7 @@ class Scratch3BoostBlocks {
|
||||||
* @param {object} args - the block's arguments.
|
* @param {object} args - the block's arguments.
|
||||||
* @property {MotorID} MOTOR_ID - the motor(s) to be affected.
|
* @property {MotorID} MOTOR_ID - the motor(s) to be affected.
|
||||||
* @property {MotorDirection} MOTOR_DIRECTION - the new direction for the motor(s).
|
* @property {MotorDirection} MOTOR_DIRECTION - the new direction for the motor(s).
|
||||||
|
* @return {Promise} - returns a promise to make sure the block yields.
|
||||||
*/
|
*/
|
||||||
setMotorDirection (args) {
|
setMotorDirection (args) {
|
||||||
// TODO: cast args.MOTOR_ID?
|
// TODO: cast args.MOTOR_ID?
|
||||||
|
@ -1824,6 +1827,7 @@ class Scratch3BoostBlocks {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
return Promise.resolve();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue