diff options
author | MW | 2007-08-13 18:25:12 +0000 |
---|---|---|
committer | MW | 2007-08-13 18:25:12 +0000 |
commit | 8af12cd9a8d3498244058ff19e4a2ce2b6bdbb8c (patch) | |
tree | 87cd5efee6a1f1d331d64f845cd51de92c582ab2 /OpenSim | |
parent | krinkec's updates to ll* interface and functions (diff) | |
download | opensim-SC-8af12cd9a8d3498244058ff19e4a2ce2b6bdbb8c.zip opensim-SC-8af12cd9a8d3498244058ff19e4a2ce2b6bdbb8c.tar.gz opensim-SC-8af12cd9a8d3498244058ff19e4a2ce2b6bdbb8c.tar.bz2 opensim-SC-8af12cd9a8d3498244058ff19e4a2ce2b6bdbb8c.tar.xz |
Some more work on SceneObjectGroup
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index 42fe5eb..ad7b906 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | |||
@@ -203,20 +203,24 @@ namespace OpenSim.Region.Environment.Scenes | |||
203 | public new SceneObjectGroup Copy() | 203 | public new SceneObjectGroup Copy() |
204 | { | 204 | { |
205 | SceneObjectGroup dupe = (SceneObjectGroup)this.MemberwiseClone(); | 205 | SceneObjectGroup dupe = (SceneObjectGroup)this.MemberwiseClone(); |
206 | dupe.m_parts.Clear(); | ||
206 | dupe.Pos = new LLVector3(Pos.X, Pos.Y, Pos.Z); | 207 | dupe.Pos = new LLVector3(Pos.X, Pos.Y, Pos.Z); |
207 | dupe.m_scene = m_scene; | 208 | dupe.m_scene = m_scene; |
208 | dupe.m_regionHandle = this.m_regionHandle; | 209 | dupe.m_regionHandle = this.m_regionHandle; |
209 | 210 | ||
210 | dupe.CopyRootPart(this.m_rootPart); | 211 | dupe.CopyRootPart(this.m_rootPart); |
211 | m_scene.EventManager.OnBackup += dupe.ProcessBackup; | 212 | |
212 | 213 | List<SceneObjectPart> partList = new List<SceneObjectPart>(this.m_parts.Values); | |
213 | foreach (SceneObjectPart part in this.m_parts.Values) | 214 | foreach (SceneObjectPart part in partList) |
214 | { | 215 | { |
215 | if (part.UUID != this.m_rootPart.UUID) | 216 | if (part.UUID != this.m_rootPart.UUID) |
216 | { | 217 | { |
217 | dupe.CopyPart(part); | 218 | dupe.CopyPart(part); |
218 | } | 219 | } |
219 | } | 220 | } |
221 | dupe.UpdateParentIDs(); | ||
222 | |||
223 | m_scene.EventManager.OnBackup += dupe.ProcessBackup; | ||
220 | return dupe; | 224 | return dupe; |
221 | } | 225 | } |
222 | 226 | ||
@@ -227,6 +231,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
227 | public void CopyRootPart(SceneObjectPart part) | 231 | public void CopyRootPart(SceneObjectPart part) |
228 | { | 232 | { |
229 | SceneObjectPart newPart = part.Copy(m_scene.PrimIDAllocate()); | 233 | SceneObjectPart newPart = part.Copy(m_scene.PrimIDAllocate()); |
234 | newPart.SetParent(this); | ||
230 | this.m_parts.Add(newPart.UUID, newPart); | 235 | this.m_parts.Add(newPart.UUID, newPart); |
231 | this.SetPartAsRoot(newPart); | 236 | this.SetPartAsRoot(newPart); |
232 | } | 237 | } |
@@ -580,7 +585,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
580 | SceneObjectPart part = this.GetChildPrim(localID); | 585 | SceneObjectPart part = this.GetChildPrim(localID); |
581 | if (part != null) | 586 | if (part != null) |
582 | { | 587 | { |
583 | if (part.UUID == this.m_rootPart.UUID) | 588 | if (part.UUID== this.m_rootPart.UUID) |
584 | { | 589 | { |
585 | this.UpdateRootPosition(pos); | 590 | this.UpdateRootPosition(pos); |
586 | } | 591 | } |