From bd5e17aeb727c5920ea23dfc1946b9bd998072c4 Mon Sep 17 00:00:00 2001 From: Astralcircle <142503363+Astralcircle@users.noreply.github.com> Date: Mon, 11 May 2026 20:39:24 +0300 Subject: [PATCH] Revert "Fix #2" --- lua/weapons/gmod_tool/stools/multi_parent.lua | 28 ++----------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/lua/weapons/gmod_tool/stools/multi_parent.lua b/lua/weapons/gmod_tool/stools/multi_parent.lua index 5dd75a8..eb305e9 100644 --- a/lua/weapons/gmod_tool/stools/multi_parent.lua +++ b/lua/weapons/gmod_tool/stools/multi_parent.lua @@ -152,30 +152,6 @@ function TOOL:ParentCheck( child, parent ) return true end -function TOOL:GetParentedEnt(trace) - local ent = trace.Entity - - -- Hacky way to hit parented entity - if not ent:IsValid() then - local owner = self:GetOwner() - local trace = util.GetPlayerTrace( owner ) - - -- Identical to the toolgun code - trace.mask = bit.bor(CONTENTS_SOLID, CONTENTS_MOVEABLE, CONTENTS_MONSTER, CONTENTS_WINDOW, CONTENTS_DEBRIS, CONTENTS_GRATE, CONTENTS_AUX) - trace.mins = vector_origin - trace.maxs = vector_origin - trace.filter = { owner, owner:GetVehicle() } - - local parented_ent = util.TraceHull(trace).Entity - - if parented_ent:IsValid() and self:IsPropOwner(owner, parented_ent) then - ent = parented_ent - end - end - - return ent -end - local function sendNotification( selected, ply ) net.Start( "MultiParent_SendNotification" ) net.WriteUInt( selected, MAX_EDICT_BITS ) @@ -183,7 +159,7 @@ local function sendNotification( selected, ply ) end function TOOL:LeftClick( trace ) - local ent = self:GetParentedEnt(trace) + local ent = trace.Entity if ent:IsValid() and ent:IsPlayer() then return end if SERVER and not util.IsValidPhysicsObject( ent, trace.PhysicsBone ) then return false end @@ -274,7 +250,7 @@ function TOOL:RightClick( trace ) return true end - local ent = self:GetParentedEnt(trace) + local ent = trace.Entity if ent:IsValid() and ent:IsPlayer() then return false end if SERVER and not util.IsValidPhysicsObject( ent, trace.PhysicsBone ) then return false end