Skip to content
  • Sponsor
  • Notifications You must be signed in to change notification settings
  • Fork 0

Commit 6753d99

Browse files
committedFeb 19, 2024
Revert "Use default output value if exist"
1 parent 53956f2 commit 6753d99

File tree

4 files changed

+10
-14
lines changed

4 files changed

+10
-14
lines changed
 

‎src/constructor/Cable.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ class Cable{
2323
this.visualizeFlow();
2424

2525
if(this._disconnecting) return this.input.default;
26-
27-
let temp = this.output;
28-
return temp.value ?? temp.default;
26+
return this.output.value;
2927
}
3028

3129
activation(enable){
@@ -126,7 +124,7 @@ class Cable{
126124
inp.emit('connect', temp);
127125
out.emit('connect', {port: out, target: inp, cable: this});
128126

129-
if(out.value != null || out.default != null){
127+
if(out.value != null){
130128
inp.emit('value', temp);
131129
inp.iface.emit('port.value', temp);
132130

‎src/constructor/Port.js

+5-6
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,9 @@ Blackprint.Engine.Port = class Port extends Blackprint.Engine.CustomEvent{
189189

190190
portIface._requesting = false;
191191
if(port.feature === BP_Port.ArrayOf)
192-
return port._cache = [output.value ?? output.default];
192+
return port._cache = [output.value];
193193

194-
return port._cache = output.value ?? port.default ?? output.default;
194+
return port._cache = output.value ?? port.default;
195195
}
196196

197197
let isNotArrayPort = port.feature !== BP_Port.ArrayOf;
@@ -222,13 +222,12 @@ Blackprint.Engine.Port = class Port extends Blackprint.Engine.CustomEvent{
222222
if(Blackprint.settings.visualizeFlow)
223223
cable.visualizeFlow();
224224

225-
let gotData = output.value ?? port.default ?? output.default;
226225
if(isNotArrayPort){
227226
portIface._requesting = false;
228-
return port._cache = gotData;
227+
return port._cache = output.value ?? port.default;
229228
}
230229

231-
data[i] = gotData;
230+
data[i] = output.value;
232231
}
233232

234233
portIface._requesting = false;
@@ -240,7 +239,7 @@ Blackprint.Engine.Port = class Port extends Blackprint.Engine.CustomEvent{
240239
return port.__call ??= () => port._callAll();
241240

242241
// else type: output port, let's just return the value
243-
return port.value ?? port.default;
242+
return port.value;
244243
}
245244
};
246245

‎src/nodes/Fn.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -755,8 +755,7 @@ function BPFnInit(){
755755
this.emit(`_add.${name}`, {port: inputPort});
756756

757757
inputPort.on('value', ({ cable }) => {
758-
let temp = cable.output;
759-
outputPort.iface.node.output[outputPort.name] = temp.value ?? temp.default;
758+
outputPort.iface.node.output[outputPort.name] = cable.output.value;
760759
});
761760

762761
return inputPort;

‎src/nodes/FnPortVar.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ function BPFnVarInit(){
162162
this._listener = ({ port }) => {
163163
if(port.iface.node.routes.out != null){
164164
let { Val } = this.ref.IOutput;
165-
Val.value = port.value ?? port.default; // Change value without trigger node.update
165+
Val.value = port.value; // Change value without trigger node.update
166166

167167
let list = Val.cables;
168168
for (let i=0; i < list.length; i++) {
@@ -175,7 +175,7 @@ function BPFnVarInit(){
175175
return;
176176
}
177177

178-
this.ref.Output.Val = port.value ?? port.default;
178+
this.ref.Output.Val = port.value;
179179
};
180180

181181
port.on('value', this._listener);

0 commit comments

Comments
 (0)
Please sign in to comment.