mirror of
https://github.com/wiremod/wire.git
synced 2025-03-04 03:03:04 -05:00
Apparently nil Inputs/Outputs is supposed to be valid (#3260)
This commit is contained in:
parent
afaf942ca8
commit
b6085e5837
@ -617,29 +617,31 @@ if SERVER then
|
|||||||
function WireLib._SetInputs(ent)
|
function WireLib._SetInputs(ent)
|
||||||
local eid = ent:EntIndex()
|
local eid = ent:EntIndex()
|
||||||
local inputs = ent.Inputs
|
local inputs = ent.Inputs
|
||||||
if not inputs then return end
|
|
||||||
|
|
||||||
local ent_input_array = {}
|
local ent_input_array = {}
|
||||||
ents_with_inputs[eid] = ent_input_array
|
ents_with_inputs[eid] = ent_input_array
|
||||||
|
|
||||||
for Name, CurPort in pairs_sortvalues(inputs, WireLib.PortComparator) do
|
if inputs then
|
||||||
ent_input_array[#ent_input_array+1] = { Name, CurPort.Type, CurPort.Desc or "", CurPort.Num }
|
for Name, CurPort in pairs_sortvalues(inputs, WireLib.PortComparator) do
|
||||||
|
ent_input_array[#ent_input_array+1] = { Name, CurPort.Type, CurPort.Desc or "", CurPort.Num }
|
||||||
|
end
|
||||||
|
SendPortInfo(WirePortQueue, eid, PORT_TYPE_INPUT, inputs)
|
||||||
end
|
end
|
||||||
SendPortInfo(WirePortQueue, eid, PORT_TYPE_INPUT, inputs)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function WireLib._SetOutputs(ent)
|
function WireLib._SetOutputs(ent)
|
||||||
local eid = ent:EntIndex()
|
local eid = ent:EntIndex()
|
||||||
local outputs = ent.Outputs
|
local outputs = ent.Outputs
|
||||||
if not outputs then return end
|
|
||||||
|
|
||||||
local ent_output_array = {}
|
local ent_output_array = {}
|
||||||
ents_with_outputs[eid] = ent_output_array
|
ents_with_outputs[eid] = ent_output_array
|
||||||
|
|
||||||
for Name, CurPort in pairs_sortvalues(outputs, WireLib.PortComparator) do
|
if outputs then
|
||||||
ent_output_array[#ent_output_array+1] = { Name, CurPort.Type, CurPort.Desc or "", CurPort.Num }
|
for Name, CurPort in pairs_sortvalues(outputs, WireLib.PortComparator) do
|
||||||
|
ent_output_array[#ent_output_array+1] = { Name, CurPort.Type, CurPort.Desc or "", CurPort.Num }
|
||||||
|
end
|
||||||
|
SendPortInfo(WirePortQueue, eid, PORT_TYPE_OUTPUT, outputs)
|
||||||
end
|
end
|
||||||
SendPortInfo(WirePortQueue, eid, PORT_TYPE_OUTPUT, outputs)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function WireLib._SetLink(input)
|
function WireLib._SetLink(input)
|
||||||
|
Loading…
Reference in New Issue
Block a user