Skip to content

Commit

Permalink
Account for parents not created by the multi parent tool
Browse files Browse the repository at this point in the history
The workshop's multi parent detours GetChildren in a weird way - fixes #5
  • Loading branch information
CheezusChrust committed Mar 20, 2024
1 parent 32fae6e commit 430d10e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lua/cfw/classes/family_sv.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ do -- Class def

hook.Run("cfw.family.added", self, entity)

for child in pairs(entity:GetChildren()) do
for k, v in pairs(entity:GetChildren()) do
local child = isnumber(k) and v or k
if child == entity then continue end
if child.CFW_NO_FAMILY_TRAVERSAL then continue end

Expand All @@ -66,7 +67,8 @@ do -- Class def

if isAncestor then return end

for child in pairs(entity:GetChildren()) do
for k, v in pairs(entity:GetChildren()) do
local child = isnumber(k) and v or k
if child == entity then continue end
if child.CFW_NO_FAMILY_TRAVERSAL then continue end

Expand Down

0 comments on commit 430d10e

Please sign in to comment.