mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-23 14:32:59 -05:00
Fix check for existing hat threads (#269)
This commit is contained in:
parent
1e86d48a31
commit
c45b420115
1 changed files with 2 additions and 2 deletions
|
@ -344,7 +344,7 @@ Runtime.prototype.startHats = function (requestedHatOpcode,
|
||||||
// any existing threads starting with the top block.
|
// any existing threads starting with the top block.
|
||||||
for (var i = 0; i < instance.threads.length; i++) {
|
for (var i = 0; i < instance.threads.length; i++) {
|
||||||
if (instance.threads[i].topBlock === topBlockId &&
|
if (instance.threads[i].topBlock === topBlockId &&
|
||||||
(!opt_target || instance.threads[i].target == opt_target)) {
|
instance.threads[i].target == target) {
|
||||||
instance._removeThread(instance.threads[i]);
|
instance._removeThread(instance.threads[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -353,7 +353,7 @@ Runtime.prototype.startHats = function (requestedHatOpcode,
|
||||||
// give up if any threads with the top block are running.
|
// give up if any threads with the top block are running.
|
||||||
for (var j = 0; j < instance.threads.length; j++) {
|
for (var j = 0; j < instance.threads.length; j++) {
|
||||||
if (instance.threads[j].topBlock === topBlockId &&
|
if (instance.threads[j].topBlock === topBlockId &&
|
||||||
(!opt_target || instance.threads[j].target == opt_target)) {
|
instance.threads[j].target == target) {
|
||||||
// Some thread is already running.
|
// Some thread is already running.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue