When getting sprite by name, skip the stage

This commit is contained in:
Eric Rosenbaum 2018-02-12 15:33:27 -05:00
parent 9675a1b8cf
commit 22038c947c

View file

@ -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;
}