diff --git a/lua/weapons/gmod_tool/stools/wire_adv.lua b/lua/weapons/gmod_tool/stools/wire_adv.lua index ac661c9ff4..5d4c9b441a 100644 --- a/lua/weapons/gmod_tool/stools/wire_adv.lua +++ b/lua/weapons/gmod_tool/stools/wire_adv.lua @@ -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 @@ -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