From c4cf2fe6f40fd57432d8ef862ec146ea037facf5 Mon Sep 17 00:00:00 2001 From: Redox <69946827+wrefgtzweve@users.noreply.github.com> Date: Mon, 2 Nov 2026 03:33:53 +0100 Subject: [PATCH] Fix wireindex error --- lua/weapons/gmod_tool/stools/wire_adv.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lua/weapons/gmod_tool/stools/wire_adv.lua b/lua/weapons/gmod_tool/stools/wire_adv.lua index ce0d81ce5c..eac5686a26 100644 --- a/lua/weapons/gmod_tool/stools/wire_adv.lua +++ b/lua/weapons/gmod_tool/stools/wire_adv.lua @@ -617,6 +617,9 @@ elseif CLIENT then end local _, outputs = self:GetPorts( self.CurrentEntity ) + if isTableEmpty(outputs) then + self.CurrentWireIndex = math.Clamp( self.CurrentWireIndex, 1, #outputs ) + end if alt then -- Auto wiring local notwired = 0 @@ -859,7 +862,7 @@ elseif CLIENT then -- Clamp index local inputs, outputs = self:GetPorts( ent ) local check = self:GetStage() == 0 and inputs or outputs - if check then + if check and #check > 0 then self.CurrentWireIndex = math.Clamp( self.CurrentWireIndex, 1, #check ) -- Set blinking wire