mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 06:52:40 -05:00
Reverse target iteration in allScriptsDo
The `allStacksAndOwnersDo` function in Scratch 2.0 runtime iterates targets in reverse and projects sometimes rely on that for correct initialization. If, for example, each sprite runs a "go back 999 layers" or "go to front" block as its first action, the order of execution will determine the ordering of the layers. This change makes Scratch 3.0 match the Scratch 2.0 execution order.
This commit is contained in:
parent
bd76395676
commit
18107cde7b
1 changed files with 1 additions and 1 deletions
|
@ -414,7 +414,7 @@ Runtime.prototype.allScriptsDo = function (f, optTarget) {
|
|||
if (optTarget) {
|
||||
targets = [optTarget];
|
||||
}
|
||||
for (var t = 0; t < targets.length; t++) {
|
||||
for (var t = targets.length - 1; t >= 0; t--) {
|
||||
var target = targets[t];
|
||||
var scripts = target.blocks.getScripts();
|
||||
for (var j = 0; j < scripts.length; j++) {
|
||||
|
|
Loading…
Reference in a new issue