Fix a pasting bug (#476)

This commit is contained in:
march 2024-08-21 20:06:42 -07:00 committed by GitHub
parent 3092b77b7a
commit 0ff4d3046c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1163,7 +1163,10 @@ function AdvDupe2.duplicator.Paste(Player, EntityList, ConstraintList, Position,
print("AD2 PostEntityPaste Error: " .. tostring(valid))
end
end
v:GetPhysicsObject():EnableMotion(false)
if IsValid(v:GetPhysicsObject()) then
v:GetPhysicsObject():EnableMotion(false)
end
if (EntityList[_].BuildDupeInfo.DupeParentID and Parenting) then
v:SetParent(CreatedEntities[EntityList[_].BuildDupeInfo.DupeParentID])
@ -1185,7 +1188,10 @@ function AdvDupe2.duplicator.Paste(Player, EntityList, ConstraintList, Position,
print("AD2 PostEntityPaste Error: " .. tostring(valid))
end
end
v:GetPhysicsObject():EnableMotion(false)
if IsValid(v:GetPhysicsObject()) then
v:GetPhysicsObject():EnableMotion(false)
end
if (EntityList[_].BuildDupeInfo.DupeParentID and Parenting) then
v:SetParent(CreatedEntities[EntityList[_].BuildDupeInfo.DupeParentID])