diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 41 |
1 files changed, 4 insertions, 37 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index f3e8377..159a92a 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -3279,31 +3279,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
3279 | catch { } | 3279 | catch { } |
3280 | cAgent.DefaultAnim = Animator.Animations.DefaultAnimation; | 3280 | cAgent.DefaultAnim = Animator.Animations.DefaultAnimation; |
3281 | 3281 | ||
3282 | // Attachment objects | 3282 | if (Scene.AttachmentsModule != null) |
3283 | List<SceneObjectGroup> attachments = GetAttachments(); | 3283 | Scene.AttachmentsModule.CopyAttachments(this, cAgent); |
3284 | if (attachments.Count > 0) | ||
3285 | { | ||
3286 | cAgent.AttachmentObjects = new List<ISceneObject>(); | ||
3287 | cAgent.AttachmentObjectStates = new List<string>(); | ||
3288 | // IScriptModule se = m_scene.RequestModuleInterface<IScriptModule>(); | ||
3289 | InTransitScriptStates.Clear(); | ||
3290 | |||
3291 | foreach (SceneObjectGroup sog in attachments) | ||
3292 | { | ||
3293 | // We need to make a copy and pass that copy | ||
3294 | // because of transfers withn the same sim | ||
3295 | ISceneObject clone = sog.CloneForNewScene(); | ||
3296 | // Attachment module assumes that GroupPosition holds the offsets...! | ||
3297 | ((SceneObjectGroup)clone).RootPart.GroupPosition = sog.RootPart.AttachedPos; | ||
3298 | ((SceneObjectGroup)clone).IsAttachment = false; | ||
3299 | cAgent.AttachmentObjects.Add(clone); | ||
3300 | string state = sog.GetStateSnapshot(); | ||
3301 | cAgent.AttachmentObjectStates.Add(state); | ||
3302 | InTransitScriptStates.Add(state); | ||
3303 | // Let's remove the scripts of the original object here | ||
3304 | sog.RemoveScriptInstances(true); | ||
3305 | } | ||
3306 | } | ||
3307 | } | 3284 | } |
3308 | 3285 | ||
3309 | private void CopyFrom(AgentData cAgent) | 3286 | private void CopyFrom(AgentData cAgent) |
@@ -3378,18 +3355,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
3378 | if (cAgent.DefaultAnim != null) | 3355 | if (cAgent.DefaultAnim != null) |
3379 | Animator.Animations.SetDefaultAnimation(cAgent.DefaultAnim.AnimID, cAgent.DefaultAnim.SequenceNum, UUID.Zero); | 3356 | Animator.Animations.SetDefaultAnimation(cAgent.DefaultAnim.AnimID, cAgent.DefaultAnim.SequenceNum, UUID.Zero); |
3380 | 3357 | ||
3381 | if (cAgent.AttachmentObjects != null && cAgent.AttachmentObjects.Count > 0) | 3358 | if (Scene.AttachmentsModule != null) |
3382 | { | 3359 | Scene.AttachmentsModule.CopyAttachments(cAgent, this); |
3383 | m_attachments = new List<SceneObjectGroup>(); | ||
3384 | int i = 0; | ||
3385 | foreach (ISceneObject so in cAgent.AttachmentObjects) | ||
3386 | { | ||
3387 | ((SceneObjectGroup)so).LocalId = 0; | ||
3388 | ((SceneObjectGroup)so).RootPart.ClearUpdateSchedule(); | ||
3389 | so.SetState(cAgent.AttachmentObjectStates[i++], m_scene); | ||
3390 | m_scene.IncomingCreateObject(Vector3.Zero, so); | ||
3391 | } | ||
3392 | } | ||
3393 | } | 3360 | } |
3394 | 3361 | ||
3395 | public bool CopyAgent(out IAgentData agent) | 3362 | public bool CopyAgent(out IAgentData agent) |