Merge pull request #2106 from knandersen/bugfix/2105

Fix #2105 by correctly accessing motor position from BoostMotor-class
This commit is contained in:
Kevin Nørby Andersen 2019-04-09 16:46:58 -04:00 committed by GitHub
commit 3d74bbd823
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1808,8 +1808,8 @@ class Scratch3BoostBlocks {
log.warn('Asked for a motor position that doesnt exist!');
return false;
}
if (portID && this.motor(portID)) {
return MathUtil.wrapClamp(this.motor(portID).position, 0, 360);
if (portID && this._peripheral.motor(portID)) {
return MathUtil.wrapClamp(this._peripheral.motor(portID).position, 0, 360);
}
return 0;
}