mirror of
https://github.com/CapsAdmin/pac3.git
synced 2025-03-04 03:03:01 -05:00
Add recursion prevention
This commit is contained in:
parent
7a44cece34
commit
60014c0318
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user