mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 06:52:40 -05:00
Fix stack check in stepThread
The previous logic seemed to be expecting `peekStack` to return 0 when the stack was empty, but its return type is `?string` and it returns `undefined` when the stack is empty. The `!== 0` check would never pass, then, leading to problems with (for example) the "say/think and wait" blocks.
This commit is contained in:
parent
b5d7602f4f
commit
4210c6dd4c
1 changed files with 1 additions and 1 deletions
|
@ -175,7 +175,7 @@ class Sequencer {
|
|||
thread.popStack();
|
||||
}
|
||||
// Save the current block ID to notice if we did control flow.
|
||||
while ((currentBlockId = thread.peekStack()) !== 0) {
|
||||
while ((currentBlockId = thread.peekStack())) {
|
||||
let isWarpMode = thread.peekStackFrame().warpMode;
|
||||
if (isWarpMode && !thread.warpTimer) {
|
||||
// Initialize warp-mode timer if it hasn't been already.
|
||||
|
|
Loading…
Reference in a new issue