mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 15:02:52 -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) {
|
broadcastAndWait (args, util) {
|
||||||
const broadcastVar = util.runtime.getTargetForStage().lookupBroadcastMsg(
|
if (!util.stackFrame.broadcastVar) {
|
||||||
args.BROADCAST_OPTION.id, args.BROADCAST_OPTION.name);
|
util.stackFrame.broadcastVar = util.runtime.getTargetForStage().lookupBroadcastMsg(
|
||||||
if (broadcastVar) {
|
args.BROADCAST_OPTION.id, args.BROADCAST_OPTION.name);
|
||||||
const broadcastOption = broadcastVar.name;
|
}
|
||||||
|
if (util.stackFrame.broadcastVar) {
|
||||||
|
const broadcastOption = util.stackFrame.broadcastVar.name;
|
||||||
// Have we run before, starting threads?
|
// Have we run before, starting threads?
|
||||||
if (!util.stackFrame.startedThreads) {
|
if (!util.stackFrame.startedThreads) {
|
||||||
// No - start hats for this broadcast.
|
// No - start hats for this broadcast.
|
||||||
|
|
Loading…
Reference in a new issue