Skip to content

Commit

Permalink
Fix NULL error in wire_adv tool (#3075)
Browse files Browse the repository at this point in the history
* Fix NULL error

* Use tab indentation

* Fix linter warning
  • Loading branch information
wrefgtzweve authored May 22, 2024
1 parent e88e317 commit 22b28e7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lua/weapons/gmod_tool/stools/wire_adv.lua
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,11 @@ elseif CLIENT then
end

if self:GetStage() == 2 then
if not IsValid( self.CurrentEntity ) then
self:SetStage(0)
return
end

local _, outputs = self:GetPorts( self.CurrentEntity )

if alt then -- Auto wiring
Expand Down Expand Up @@ -966,7 +971,7 @@ elseif CLIENT then
end
return true
elseif name == "Selected" and self:GetStage() == 2 then
local inputs, outputs = self:GetPorts( ent )
local _, outputs = self:GetPorts( ent )
if not isTableEmpty(outputs) then return false end
if self:GetOwner():KeyDown( IN_WALK ) then -- Gray out the ones that won't be able to be wired to any input
for i=1,#outputs do
Expand Down

0 comments on commit 22b28e7

Please sign in to comment.