Skip to content

Commit bc790d4

Browse files
committed
Fix node replacement
1 parent cad10c2 commit bc790d4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

scripts/sound/AudioBus.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,21 +92,21 @@ AudioBus.prototype.findPrevNode = function(_idx)
9292

9393
AudioBus.prototype.handleConnections = function(_idx, _newNodes)
9494
{
95-
const currentNode = this.nodes[_idx];
95+
const currentNodes = this.nodes[_idx];
9696

97-
if (currentNode === undefined && _newNodes === undefined)
97+
if (currentNodes === undefined && _newNodes === undefined)
9898
return; // No need to change anything
9999

100100
const prevNode = this.findPrevNode(_idx);
101101
const nextNode = this.findNextNode(_idx);
102102

103103
// Disconnect the previous node
104-
if (currentNode !== undefined)
104+
if (currentNodes !== undefined)
105105
{
106-
prevNode.disconnect(currentNode);
106+
prevNode.disconnect(currentNodes.input);
107107

108-
currentNode.disconnect();
109-
this.effects[_idx].removeNode(currentNode);
108+
currentNodes.output.disconnect();
109+
this.effects[_idx].removeNode(currentNodes.output);
110110
}
111111
else
112112
{

0 commit comments

Comments
 (0)