mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-01-08 14:01:58 -05:00
Merge pull request #2557 from ericrosenbaum/broadcast-wait-var-change-fix
Prevent "broadcast and wait" being interrupted by a change to its input
This commit is contained in:
commit
9329f93e74
2 changed files with 6 additions and 4 deletions
|
@ -90,10 +90,12 @@ class Scratch3EventBlocks {
|
|||
}
|
||||
|
||||
broadcastAndWait (args, util) {
|
||||
const broadcastVar = util.runtime.getTargetForStage().lookupBroadcastMsg(
|
||||
args.BROADCAST_OPTION.id, args.BROADCAST_OPTION.name);
|
||||
if (broadcastVar) {
|
||||
const broadcastOption = broadcastVar.name;
|
||||
if (!util.stackFrame.broadcastVar) {
|
||||
util.stackFrame.broadcastVar = util.runtime.getTargetForStage().lookupBroadcastMsg(
|
||||
args.BROADCAST_OPTION.id, args.BROADCAST_OPTION.name);
|
||||
}
|
||||
if (util.stackFrame.broadcastVar) {
|
||||
const broadcastOption = util.stackFrame.broadcastVar.name;
|
||||
// Have we run before, starting threads?
|
||||
if (!util.stackFrame.startedThreads) {
|
||||
// No - start hats for this broadcast.
|
||||
|
|
BIN
test/fixtures/execute/broadcast-wait-arg-change.sb2
vendored
Normal file
BIN
test/fixtures/execute/broadcast-wait-arg-change.sb2
vendored
Normal file
Binary file not shown.
Loading…
Reference in a new issue