diff options
author | Justin Clark-Casey (justincc) | 2011-08-26 22:49:11 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-08-26 22:49:11 +0100 |
commit | 5f3ffc195f60ac54492ccb389843f292b0be7511 (patch) | |
tree | 37ac2512d76923f91e9f4715bee3dd8cbca7d0a1 /OpenSim/Region/Framework/Scenes | |
parent | refactor: simplify DetachSingleAttachmentToGround() by retrieving the scene o... (diff) | |
download | opensim-SC_OLD-5f3ffc195f60ac54492ccb389843f292b0be7511.zip opensim-SC_OLD-5f3ffc195f60ac54492ccb389843f292b0be7511.tar.gz opensim-SC_OLD-5f3ffc195f60ac54492ccb389843f292b0be7511.tar.bz2 opensim-SC_OLD-5f3ffc195f60ac54492ccb389843f292b0be7511.tar.xz |
refactor: move SOG.DetachToGround() to AttachmentsModule.DetachSceneObjectToGround() and remove redundant code
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 46 |
1 files changed, 6 insertions, 40 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 00e3363..e3b8fc8 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -979,43 +979,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
979 | return m_rootPart.Shape.State; | 979 | return m_rootPart.Shape.State; |
980 | } | 980 | } |
981 | 981 | ||
982 | public void ClearPartAttachmentData() | 982 | public void SetAttachmentPoint(byte point) |
983 | { | ||
984 | SetAttachmentPoint((Byte)0); | ||
985 | } | ||
986 | |||
987 | public void DetachToGround() | ||
988 | { | 983 | { |
989 | ScenePresence avatar = m_scene.GetScenePresence(m_rootPart.AttachedAvatar); | ||
990 | if (avatar == null) | ||
991 | return; | ||
992 | |||
993 | avatar.RemoveAttachment(this); | ||
994 | |||
995 | Vector3 detachedpos = new Vector3(127f,127f,127f); | ||
996 | if (avatar == null) | ||
997 | return; | ||
998 | |||
999 | detachedpos = avatar.AbsolutePosition; | ||
1000 | RootPart.FromItemID = UUID.Zero; | ||
1001 | |||
1002 | AbsolutePosition = detachedpos; | ||
1003 | m_rootPart.AttachedAvatar = UUID.Zero; | ||
1004 | |||
1005 | SceneObjectPart[] parts = m_parts.GetArray(); | 984 | SceneObjectPart[] parts = m_parts.GetArray(); |
1006 | for (int i = 0; i < parts.Length; i++) | 985 | for (int i = 0; i < parts.Length; i++) |
1007 | parts[i].AttachedAvatar = UUID.Zero; | 986 | parts[i].SetAttachmentPoint(point); |
987 | } | ||
1008 | 988 | ||
1009 | m_rootPart.SetParentLocalId(0); | 989 | public void ClearPartAttachmentData() |
1010 | SetAttachmentPoint((byte)0); | 990 | { |
1011 | m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive, m_scene.m_physicalPrim); | 991 | SetAttachmentPoint((Byte)0); |
1012 | HasGroupChanged = true; | ||
1013 | RootPart.Rezzed = DateTime.Now; | ||
1014 | RootPart.RemFlag(PrimFlags.TemporaryOnRez); | ||
1015 | AttachToBackup(); | ||
1016 | m_scene.EventManager.TriggerParcelPrimCountTainted(); | ||
1017 | m_rootPart.ScheduleFullUpdate(); | ||
1018 | m_rootPart.ClearUndoState(); | ||
1019 | } | 992 | } |
1020 | 993 | ||
1021 | /// <summary> | 994 | /// <summary> |
@@ -3349,13 +3322,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3349 | return String.Format("{0} {1} ({2})", Name, UUID, AbsolutePosition); | 3322 | return String.Format("{0} {1} ({2})", Name, UUID, AbsolutePosition); |
3350 | } | 3323 | } |
3351 | 3324 | ||
3352 | public void SetAttachmentPoint(byte point) | ||
3353 | { | ||
3354 | SceneObjectPart[] parts = m_parts.GetArray(); | ||
3355 | for (int i = 0; i < parts.Length; i++) | ||
3356 | parts[i].SetAttachmentPoint(point); | ||
3357 | } | ||
3358 | |||
3359 | #region ISceneObject | 3325 | #region ISceneObject |
3360 | 3326 | ||
3361 | public virtual ISceneObject CloneForNewScene() | 3327 | public virtual ISceneObject CloneForNewScene() |