mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 23:12:24 -05:00
Fix for ending warp bug
When popping down the stack frame it is assumed that you keep using the previous warp state rather than looking at the warp state of the level you just popped out to. This causes the loss of screen updates if the warping block was the last statement in a loop as the loop does not obey it's 'non warp' status.
This commit is contained in:
parent
bdabe2efa3
commit
5f100129b6
1 changed files with 7 additions and 2 deletions
|
@ -131,12 +131,17 @@ Sequencer.prototype.stepThread = function (thread) {
|
||||||
// If no next block has been found at this point, look on the stack.
|
// If no next block has been found at this point, look on the stack.
|
||||||
while (!thread.peekStack()) {
|
while (!thread.peekStack()) {
|
||||||
thread.popStack();
|
thread.popStack();
|
||||||
|
|
||||||
if (thread.stack.length === 0) {
|
if (thread.stack.length === 0) {
|
||||||
// No more stack to run!
|
// No more stack to run!
|
||||||
thread.status = Thread.STATUS_DONE;
|
thread.status = Thread.STATUS_DONE;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (thread.peekStackFrame().isLoop) {
|
|
||||||
|
var stackFrame = thread.peekStackFrame();
|
||||||
|
isWarpMode = stackFrame.warpMode;
|
||||||
|
|
||||||
|
if (stackFrame.isLoop) {
|
||||||
// The current level of the stack is marked as a loop.
|
// The current level of the stack is marked as a loop.
|
||||||
// Return to yield for the frame/tick in general.
|
// Return to yield for the frame/tick in general.
|
||||||
// Unless we're in warp mode - then only return if the
|
// Unless we're in warp mode - then only return if the
|
||||||
|
@ -151,7 +156,7 @@ Sequencer.prototype.stepThread = function (thread) {
|
||||||
// since loops need to be re-executed.
|
// since loops need to be re-executed.
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
} else if (thread.peekStackFrame().waitingReporter) {
|
} else if (stackFrame.waitingReporter) {
|
||||||
// This level of the stack was waiting for a value.
|
// This level of the stack was waiting for a value.
|
||||||
// This means a reporter has just returned - so don't go
|
// This means a reporter has just returned - so don't go
|
||||||
// to the next block for this level of the stack.
|
// to the next block for this level of the stack.
|
||||||
|
|
Loading…
Reference in a new issue