Added an extra check to ENT:GetLinks()

- In some cases, you could use ENT:GetLinks() on entities that were never linked before, now we'll make sure that's the case before copying that table.
This commit is contained in:
TwistedTail 2024-06-23 03:52:18 -04:00
parent 2aafe1b6b6
commit 0a31f7e20c

View File

@ -89,10 +89,13 @@ do
end
function ENT:GetLinks() -- Creates a shallow copy of the links table
local out = {}
local links = self._links
local out = {}
for k, v in pairs(self._links) do
out[k] = v
if links then
for k, v in pairs(links) do
out[k] = v
end
end
return out