From 430d10e2a2d4c1886163ece76b7ebb68295f2e64 Mon Sep 17 00:00:00 2001 From: Matt Date: Wed, 20 Mar 2024 15:26:22 -0400 Subject: [PATCH] Account for parents not created by the multi parent tool The workshop's multi parent detours GetChildren in a weird way - fixes https://github.com/ACF-Team/CFW/issues/5 --- lua/cfw/classes/family_sv.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lua/cfw/classes/family_sv.lua b/lua/cfw/classes/family_sv.lua index d1f5ab9..c14a040 100644 --- a/lua/cfw/classes/family_sv.lua +++ b/lua/cfw/classes/family_sv.lua @@ -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 @@ -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