From 22038c947c246dd1b960ca2c845d54c55a6b4d57 Mon Sep 17 00:00:00 2001 From: Eric Rosenbaum Date: Mon, 12 Feb 2018 15:33:27 -0500 Subject: [PATCH] When getting sprite by name, skip the stage --- src/engine/runtime.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/engine/runtime.js b/src/engine/runtime.js index bf7969a0c..739d36295 100644 --- a/src/engine/runtime.js +++ b/src/engine/runtime.js @@ -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; }