mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-01-10 15:02:06 -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});
|
||||
}
|
||||
|
||||
// Delete substacks and fields
|
||||
for (var field in block.fields) {
|
||||
if (field === 'SUBSTACK') {
|
||||
this.deleteBlock({id: block.fields[field].value});
|
||||
} else {
|
||||
for (var shadow in block.fields[field].blocks) {
|
||||
this.deleteBlock({id: shadow});
|
||||
}
|
||||
// Delete inputs (including substacks)
|
||||
for (var input in block.inputs) {
|
||||
// If it's null, the block in this input moved away.
|
||||
if (block.inputs[input].block !== null) {
|
||||
this.deleteBlock({id: block.inputs[input].block});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue