diff options
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/Attachments')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index 25d4f21..8c92588 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | |||
@@ -133,8 +133,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
133 | "[ATTACHMENTS MODULE]: Saving avatar attachment. AgentID: " + remoteClient.AgentId | 133 | "[ATTACHMENTS MODULE]: Saving avatar attachment. AgentID: " + remoteClient.AgentId |
134 | + ", AttachmentPoint: " + AttachmentPt); | 134 | + ", AttachmentPoint: " + AttachmentPt); |
135 | 135 | ||
136 | if (m_scene.AvatarFactory != null) | ||
137 | m_scene.AvatarFactory.QueueAppearanceSave(remoteClient.AgentId); | ||
138 | } | 136 | } |
139 | } | 137 | } |
140 | catch (Exception e) | 138 | catch (Exception e) |
@@ -346,8 +344,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
346 | if (m_scene.InventoryService != null) | 344 | if (m_scene.InventoryService != null) |
347 | item = m_scene.InventoryService.GetItem(item); | 345 | item = m_scene.InventoryService.GetItem(item); |
348 | 346 | ||
349 | if (presence.Appearance != null) | 347 | bool changed = presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID); |
350 | presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/); | 348 | if (changed && m_scene.AvatarFactory != null) |
349 | m_scene.AvatarFactory.QueueAppearanceSave(remoteClient.AgentId); | ||
351 | } | 350 | } |
352 | 351 | ||
353 | return att.UUID; | 352 | return att.UUID; |
@@ -397,9 +396,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
397 | if (m_scene.InventoryService == null) | 396 | if (m_scene.InventoryService == null) |
398 | m_log.Error("[ATTACHMENT]: m_scene.InventoryService == null"); | 397 | m_log.Error("[ATTACHMENT]: m_scene.InventoryService == null"); |
399 | item = m_scene.InventoryService.GetItem(item); | 398 | item = m_scene.InventoryService.GetItem(item); |
400 | presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /* att.UUID */); | 399 | bool changed = presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID); |
401 | 400 | if (changed && m_scene.AvatarFactory != null) | |
402 | if (m_scene.AvatarFactory != null) | ||
403 | m_scene.AvatarFactory.QueueAppearanceSave(remoteClient.AgentId); | 401 | m_scene.AvatarFactory.QueueAppearanceSave(remoteClient.AgentId); |
404 | } | 402 | } |
405 | } | 403 | } |
@@ -419,11 +417,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
419 | ScenePresence presence; | 417 | ScenePresence presence; |
420 | if (m_scene.TryGetScenePresence(remoteClient.AgentId, out presence)) | 418 | if (m_scene.TryGetScenePresence(remoteClient.AgentId, out presence)) |
421 | { | 419 | { |
422 | presence.Appearance.DetachAttachment(itemID); | ||
423 | |||
424 | // Save avatar attachment information | 420 | // Save avatar attachment information |
425 | m_log.Debug("[ATTACHMENTS MODULE]: Detaching from UserID: " + remoteClient.AgentId + ", ItemID: " + itemID); | 421 | m_log.Debug("[ATTACHMENTS MODULE]: Detaching from UserID: " + remoteClient.AgentId + ", ItemID: " + itemID); |
426 | if (m_scene.AvatarFactory != null) | 422 | |
423 | bool changed = presence.Appearance.DetachAttachment(itemID); | ||
424 | if (changed && m_scene.AvatarFactory != null) | ||
427 | m_scene.AvatarFactory.QueueAppearanceSave(remoteClient.AgentId); | 425 | m_scene.AvatarFactory.QueueAppearanceSave(remoteClient.AgentId); |
428 | } | 426 | } |
429 | 427 | ||
@@ -448,9 +446,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
448 | part.ParentGroup.PrimCount, remoteClient.AgentId, presence.AbsolutePosition)) | 446 | part.ParentGroup.PrimCount, remoteClient.AgentId, presence.AbsolutePosition)) |
449 | return; | 447 | return; |
450 | 448 | ||
451 | presence.Appearance.DetachAttachment(itemID); | 449 | bool changed = presence.Appearance.DetachAttachment(itemID); |
452 | 450 | if (changed && m_scene.AvatarFactory != null) | |
453 | if (m_scene.AvatarFactory != null) | ||
454 | m_scene.AvatarFactory.QueueAppearanceSave(remoteClient.AgentId); | 451 | m_scene.AvatarFactory.QueueAppearanceSave(remoteClient.AgentId); |
455 | 452 | ||
456 | part.ParentGroup.DetachToGround(); | 453 | part.ParentGroup.DetachToGround(); |