Merge pull request #206 from thegrb93/find-parented-props

Add parented entities to copy. Fixes: #204
This commit is contained in:
thegrb93 2019-02-14 14:30:40 -05:00 committed by GitHub
commit f294fe2551
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -353,6 +353,14 @@ local function Copy( Ent, EntTable, ConstraintTable, Offset )
end
end
end
do -- Parented stuff
local parent = Ent:GetParent()
if IsValid(parent) then Copy(parent, EntTable, ConstraintTable, Offset) end
for k, child in pairs(Ent:GetChildren()) do
Copy(child, EntTable, ConstraintTable, Offset)
end
end
for k,v in pairs(EntTable[Ent:EntIndex()].PhysicsObjects)do
Ent:GetPhysicsObjectNum(k):EnableMotion(v.Frozen)