mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-07-29 07:29:12 -04:00
Add Thread.blockContainer
Store the thread's blocks at blockContainer letting execute quickly determine the block source. Monitor threads are a monitor thread. They do not become a target thread suddenly.
This commit is contained in:
parent
ab8d8e5f34
commit
4286e3e982
4 changed files with 13 additions and 7 deletions
src/engine
|
@ -126,12 +126,7 @@ const execute = function (sequencer, thread, recursiveCall) {
|
|||
const currentBlockId = thread.peekStack();
|
||||
const currentStackFrame = thread.peekStackFrame();
|
||||
|
||||
let blockContainer;
|
||||
if (thread.updateMonitor) {
|
||||
blockContainer = runtime.monitorBlocks;
|
||||
} else {
|
||||
blockContainer = target.blocks;
|
||||
}
|
||||
let blockContainer = thread.blockContainer;
|
||||
let block = blockContainer.getBlock(currentBlockId);
|
||||
if (typeof block === 'undefined') {
|
||||
blockContainer = runtime.flyoutBlocks;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue