Add recursion prevention

This commit is contained in:
Redox 2023-07-08 19:54:38 +02:00
parent 7a44cece34
commit 60014c0318
No known key found for this signature in database
GPG Key ID: C10A433A95068388

View File

@ -200,12 +200,10 @@ do -- owner
end
function PART:GetParentOwner()
if self.TargetEntity:IsValid() and self.TargetEntity ~= self then
return self.TargetEntity:GetOwner()
end
for _, parent in ipairs(self:GetParentList()) do
-- legacy behavior
@ -219,8 +217,10 @@ do -- owner
end
end
local owner = parent:GetOwner()
if owner:IsValid() then return owner end
if parent ~= self then
local owner = parent:GetOwner()
if owner:IsValid() then return owner end
end
end
return NULL