Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apparently nil Inputs/Outputs is supposed to be valid #3260

Merged
merged 1 commit into from
Feb 10, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions lua/wire/wireshared.lua
Original file line number Diff line number Diff line change
Expand Up @@ -617,29 +617,31 @@ if SERVER then
function WireLib._SetInputs(ent)
local eid = ent:EntIndex()
local inputs = ent.Inputs
if not inputs then return end

local ent_input_array = {}
ents_with_inputs[eid] = ent_input_array

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 }
if inputs then
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
SendPortInfo(WirePortQueue, eid, PORT_TYPE_INPUT, inputs)
end

function WireLib._SetOutputs(ent)
local eid = ent:EntIndex()
local outputs = ent.Outputs
if not outputs then return end

local ent_output_array = {}
ents_with_outputs[eid] = ent_output_array

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 }
if outputs then
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
SendPortInfo(WirePortQueue, eid, PORT_TYPE_OUTPUT, outputs)
end

function WireLib._SetLink(input)
Expand Down
Loading