mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-23 14:32:59 -05:00
Merge pull request #933 from ericrosenbaum/bugfix/handle-sprites-named-stage
When getting sprite by name, skip the stage
This commit is contained in:
commit
a8e2972a7c
1 changed files with 3 additions and 0 deletions
|
@ -1458,6 +1458,9 @@ class Runtime extends EventEmitter {
|
|||
getSpriteTargetByName (spriteName) {
|
||||
for (let i = 0; i < this.targets.length; i++) {
|
||||
const target = this.targets[i];
|
||||
if (target.isStage) {
|
||||
continue;
|
||||
}
|
||||
if (target.sprite && target.sprite.name === spriteName) {
|
||||
return target;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue