Add parented entities to copy. Fixes: #204

This commit is contained in:
Garrett Brown 2019-02-10 23:42:26 -05:00
parent 7fed519938
commit 69455e640c

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)