mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-23 14:32:59 -05:00
When getting sprite by name, skip the stage
This commit is contained in:
parent
9675a1b8cf
commit
22038c947c
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