mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 06:52:40 -05:00
Fix whenColor hat
This commit is contained in:
parent
3d74bbd823
commit
c0ea5be1d3
1 changed files with 3 additions and 3 deletions
|
@ -1925,7 +1925,7 @@ class Scratch3BoostBlocks {
|
||||||
* @return {boolean} - true if the tilt sensor is tilted past a threshold in the specified direction.
|
* @return {boolean} - true if the tilt sensor is tilted past a threshold in the specified direction.
|
||||||
*/
|
*/
|
||||||
whenColor (args) {
|
whenColor (args) {
|
||||||
return this._isColor(args.COLOR);
|
return this._isColor(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1944,7 +1944,7 @@ class Scratch3BoostBlocks {
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
_isColor (args) {
|
_isColor (args) {
|
||||||
switch (args) {
|
switch (args.COLOR) {
|
||||||
case BoostColorLabel.ANY:
|
case BoostColorLabel.ANY:
|
||||||
if (Object.keys(BoostColor).find(key => BoostColor[key])
|
if (Object.keys(BoostColor).find(key => BoostColor[key])
|
||||||
.toLowerCase() !== this.getColor()) {
|
.toLowerCase() !== this.getColor()) {
|
||||||
|
@ -1956,7 +1956,7 @@ class Scratch3BoostBlocks {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return this.getColor() === color;
|
return this.getColor() === args.COLOR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue