diff options
author | Justin Clark-Casey (justincc) | 2010-02-08 19:10:54 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2010-02-08 19:10:54 +0000 |
commit | 9f4883d1468b5fe1c60e1831b24e1fed1eb5caeb (patch) | |
tree | b47729153fe86d031ef2a442996fb4d864e73ffb /OpenSim/Region/Framework | |
parent | Add EventManager.OnIncomingSceneObject event which is triggered by an incomin... (diff) | |
download | opensim-SC_OLD-9f4883d1468b5fe1c60e1831b24e1fed1eb5caeb.zip opensim-SC_OLD-9f4883d1468b5fe1c60e1831b24e1fed1eb5caeb.tar.gz opensim-SC_OLD-9f4883d1468b5fe1c60e1831b24e1fed1eb5caeb.tar.bz2 opensim-SC_OLD-9f4883d1468b5fe1c60e1831b24e1fed1eb5caeb.tar.xz |
refactor: Reuse SceneObjectGroup.IsAttachmentCheckFull() in Scene.AddSceneObject since this wraps a check that is much less clear
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 6 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 11 |
2 files changed, 12 insertions, 5 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 039d074..ddebd0b 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -2483,7 +2483,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2483 | foreach (SceneObjectPart p in sceneObject.Children.Values) | 2483 | foreach (SceneObjectPart p in sceneObject.Children.Values) |
2484 | p.LocalId = 0; | 2484 | p.LocalId = 0; |
2485 | 2485 | ||
2486 | if ((sceneObject.RootPart.Shape.PCode == (byte)PCode.Prim) && (sceneObject.RootPart.Shape.State != 0)) // Attachment | 2486 | if (sceneObject.IsAttachmentCheckFull()) // Attachment |
2487 | { | 2487 | { |
2488 | sceneObject.RootPart.AddFlag(PrimFlags.TemporaryOnRez); | 2488 | sceneObject.RootPart.AddFlag(PrimFlags.TemporaryOnRez); |
2489 | sceneObject.RootPart.AddFlag(PrimFlags.Phantom); | 2489 | sceneObject.RootPart.AddFlag(PrimFlags.Phantom); |
@@ -2518,9 +2518,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2518 | AttachObject( | 2518 | AttachObject( |
2519 | sp.ControllingClient, grp.LocalId, (uint)0, grp.GroupRotation, grp.AbsolutePosition, false); | 2519 | sp.ControllingClient, grp.LocalId, (uint)0, grp.GroupRotation, grp.AbsolutePosition, false); |
2520 | RootPrim.RemFlag(PrimFlags.TemporaryOnRez); | 2520 | RootPrim.RemFlag(PrimFlags.TemporaryOnRez); |
2521 | grp.SendGroupFullUpdate(); | 2521 | grp.SendGroupFullUpdate(); |
2522 | |||
2523 | |||
2524 | } | 2522 | } |
2525 | else | 2523 | else |
2526 | { | 2524 | { |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 8c56870..af46659 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -268,7 +268,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
268 | } | 268 | } |
269 | } | 269 | } |
270 | 270 | ||
271 | private bool IsAttachmentCheckFull() | 271 | /// <summary> |
272 | /// Check both the attachment property and the relevant properties of the underlying root part. | ||
273 | /// </summary> | ||
274 | /// This is necessary in some cases, particularly when a scene object has just crossed into a region and doesn't | ||
275 | /// have the IsAttachment property yet checked. | ||
276 | /// | ||
277 | /// FIXME: However, this should be fixed so that this property | ||
278 | /// propertly reflects the underlying status. | ||
279 | /// <returns></returns> | ||
280 | public bool IsAttachmentCheckFull() | ||
272 | { | 281 | { |
273 | return (IsAttachment || (m_rootPart.Shape.PCode == 9 && m_rootPart.Shape.State != 0)); | 282 | return (IsAttachment || (m_rootPart.Shape.PCode == 9 && m_rootPart.Shape.State != 0)); |
274 | } | 283 | } |