File tree Expand file tree Collapse file tree
lua/entities/gmod_wire_fpga Expand file tree Collapse file tree Original file line number Diff line number Diff line change 225225function ENT :SynthesizeViewData (data )
226226 if not data .Nodes then return end
227227
228+ function getInputAmountForNode (node )
229+ local gate = getGate (node )
230+ local amountOfInputs = 0
231+ if gate .compact_inputs then
232+ inputLimit = gate .compact_inputs
233+ for inputIdx , _ in pairs (node .connections ) do
234+ inputLimit = math.max (inputLimit , inputIdx + 1 )
235+ end
236+ amountOfInputs = math.min (# gate .inputs , inputLimit )
237+ else
238+ amountOfInputs = # gate .inputs
239+ end
240+ return amountOfInputs
241+ end
242+
228243 local viewData = {}
229244
230245 viewData .Nodes = {}
@@ -247,9 +262,9 @@ function ENT:SynthesizeViewData(data)
247262
248263 local ports
249264 if gate .outputs then
250- ports = math.max (# gate . inputs , # gate .outputs )
265+ ports = math.max (getInputAmountForNode ( node ) , # gate .outputs )
251266 else
252- ports = # gate . inputs
267+ ports = getInputAmountForNode ( node )
253268 end
254269
255270 table.insert (viewData .Nodes , {
You can’t perform that action at this time.
0 commit comments