mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 06:52:40 -05:00
store broadcastVar on stackFrame to prevent canceling
a broadcast early if the variable changes
This commit is contained in:
parent
5f10125643
commit
a2b4cf8cfb
1 changed files with 6 additions and 4 deletions
|
@ -90,10 +90,12 @@ class Scratch3EventBlocks {
|
|||
}
|
||||
|
||||
broadcastAndWait (args, util) {
|
||||
const broadcastVar = util.runtime.getTargetForStage().lookupBroadcastMsg(
|
||||
if (!util.stackFrame.broadcastVar) {
|
||||
util.stackFrame.broadcastVar = util.runtime.getTargetForStage().lookupBroadcastMsg(
|
||||
args.BROADCAST_OPTION.id, args.BROADCAST_OPTION.name);
|
||||
if (broadcastVar) {
|
||||
const broadcastOption = broadcastVar.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.
|
||||
|
|
Loading…
Reference in a new issue