Skip to content
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
3 changes: 2 additions & 1 deletion lua/entities/gmod_wire_expression2/core/wirelink.lua
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,8 @@

--- Returns an array of all the inputs that <this> has without their types. Returns an empty array if it has none
e2function array wirelink:inputs()
if not validWirelink(self, this) then return {} end

Check warning on line 297 in lua/entities/gmod_wire_expression2/core/wirelink.lua

View workflow job for this annotation

GitHub Actions / lint

"Syntax inconsistency"

Inconsistent use of '!' and 'not'
if(!this.Inputs) then return {} end

Check warning on line 298 in lua/entities/gmod_wire_expression2/core/wirelink.lua

View workflow job for this annotation

GitHub Actions / lint

"Syntax inconsistency"

Inconsistent use of '!' and 'not'

local InputNames = {}
for k,v in pairs_sortvalues(this.Inputs, WireLib.PortComparator) do
Expand All @@ -306,8 +306,8 @@

--- Returns an array of all the outputs that <this> has without their types. Returns an empty array if it has none
e2function array wirelink:outputs()
if not validWirelink(self, this) then return {} end

Check warning on line 309 in lua/entities/gmod_wire_expression2/core/wirelink.lua

View workflow job for this annotation

GitHub Actions / lint

"Syntax inconsistency"

Inconsistent use of '!' and 'not'
if(!this.Outputs) then return {} end

Check warning on line 310 in lua/entities/gmod_wire_expression2/core/wirelink.lua

View workflow job for this annotation

GitHub Actions / lint

"Syntax inconsistency"

Inconsistent use of '!' and 'not'

local OutputNames = {}
for k,v in pairs_sortvalues(this.Outputs, WireLib.PortComparator) do
Expand All @@ -318,8 +318,8 @@

--- Returns the type of input that <Input> is in lowercase. ( "NORMAL" is changed to "number" )
e2function string wirelink:inputType(string Input)
if not validWirelink(self, this) then return "" end

Check warning on line 321 in lua/entities/gmod_wire_expression2/core/wirelink.lua

View workflow job for this annotation

GitHub Actions / lint

"Syntax inconsistency"

Inconsistent use of '!' and 'not'
if(!this.Inputs or !this.Inputs[Input]) then return "" end

Check warning on line 322 in lua/entities/gmod_wire_expression2/core/wirelink.lua

View workflow job for this annotation

GitHub Actions / lint

"Syntax inconsistency"

Inconsistent use of 'not' and '!'

Check warning on line 322 in lua/entities/gmod_wire_expression2/core/wirelink.lua

View workflow job for this annotation

GitHub Actions / lint

"Syntax inconsistency"

Inconsistent use of '!' and 'not'

local Type = this.Inputs[Input].Type or ""
if Type == "NORMAL" then Type = "number" end
Expand All @@ -328,8 +328,8 @@

--- Returns the type of output that <Output> is in lowercase. ( "NORMAL" is changed to "number" )
e2function string wirelink:outputType(string Output)
if not validWirelink(self, this) then return "" end

Check warning on line 331 in lua/entities/gmod_wire_expression2/core/wirelink.lua

View workflow job for this annotation

GitHub Actions / lint

"Syntax inconsistency"

Inconsistent use of 'not' and '!'
if(!this.Outputs or !this.Outputs[Output]) then return "" end

Check warning on line 332 in lua/entities/gmod_wire_expression2/core/wirelink.lua

View workflow job for this annotation

GitHub Actions / lint

"Syntax inconsistency"

Inconsistent use of 'not' and '!'

local Type = this.Outputs[Output].Type or ""
if Type == "NORMAL" then Type = "number" end
Expand All @@ -342,7 +342,7 @@

[deprecated]
e2function number wirelink:writeCell(address, value)
if not validWirelink(self, this) then return 0 end

Check warning on line 345 in lua/entities/gmod_wire_expression2/core/wirelink.lua

View workflow job for this annotation

GitHub Actions / lint

"Syntax inconsistency"

Inconsistent use of 'not' and '!'

if not this.WriteCell then return 0 end
if this:WriteCell(address, value) then return 1 else return 0 end
Expand All @@ -357,10 +357,11 @@
end

e2function array wirelink:readArray(start, size)
if size < 0 then return {} end
if size < 0 or size ~= size then return {} end
if !validWirelink(self, this) or !this.ReadCell then return {} end

self.prf = self.prf + size
if self.prf > e2_tickquota then error("perf", 0) return end

local ret = {}

Expand Down
Loading