mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-01-25 09:01:07 -05:00
Update runtime's handling of delete for new blocks structure
This commit is contained in:
parent
285c2792ef
commit
18e4228399
1 changed files with 5 additions and 8 deletions
|
@ -168,14 +168,11 @@ Runtime.prototype.deleteBlock = function (e) {
|
||||||
this.deleteBlock({id: block.next});
|
this.deleteBlock({id: block.next});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Delete substacks and fields
|
// Delete inputs (including substacks)
|
||||||
for (var field in block.fields) {
|
for (var input in block.inputs) {
|
||||||
if (field === 'SUBSTACK') {
|
// If it's null, the block in this input moved away.
|
||||||
this.deleteBlock({id: block.fields[field].value});
|
if (block.inputs[input].block !== null) {
|
||||||
} else {
|
this.deleteBlock({id: block.inputs[input].block});
|
||||||
for (var shadow in block.fields[field].blocks) {
|
|
||||||
this.deleteBlock({id: shadow});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue