diff options
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index 37f790d..f8fb7ca 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | |||
@@ -341,6 +341,38 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
341 | DetachSingleAttachmentToInv(itemID, remoteClient); | 341 | DetachSingleAttachmentToInv(itemID, remoteClient); |
342 | } | 342 | } |
343 | 343 | ||
344 | public void DetachSingleAttachmentToGround(UUID itemID, IClientAPI remoteClient) | ||
345 | { | ||
346 | SceneObjectPart part = m_scene.GetSceneObjectPart(itemID); | ||
347 | if (part == null || part.ParentGroup == null) | ||
348 | return; | ||
349 | |||
350 | UUID inventoryID = part.ParentGroup.GetFromItemID(); | ||
351 | |||
352 | ScenePresence presence; | ||
353 | if (m_scene.TryGetScenePresence(remoteClient.AgentId, out presence)) | ||
354 | { | ||
355 | if (!m_scene.Permissions.CanRezObject( | ||
356 | part.ParentGroup.Children.Count, remoteClient.AgentId, presence.AbsolutePosition)) | ||
357 | return; | ||
358 | |||
359 | presence.Appearance.DetachAttachment(itemID); | ||
360 | |||
361 | if (m_scene.AvatarFactory != null) | ||
362 | { | ||
363 | m_scene.AvatarFactory.UpdateDatabase(remoteClient.AgentId, presence.Appearance); | ||
364 | } | ||
365 | part.ParentGroup.DetachToGround(); | ||
366 | |||
367 | List<UUID> uuids = new List<UUID>(); | ||
368 | uuids.Add(inventoryID); | ||
369 | m_scene.InventoryService.DeleteItems(remoteClient.AgentId, uuids); | ||
370 | remoteClient.SendRemoveInventoryItem(inventoryID); | ||
371 | } | ||
372 | |||
373 | m_scene.EventManager.TriggerOnAttach(part.ParentGroup.LocalId, itemID, UUID.Zero); | ||
374 | } | ||
375 | |||
344 | // What makes this method odd and unique is it tries to detach using an UUID.... Yay for standards. | 376 | // What makes this method odd and unique is it tries to detach using an UUID.... Yay for standards. |
345 | // To LocalId or UUID, *THAT* is the question. How now Brown UUID?? | 377 | // To LocalId or UUID, *THAT* is the question. How now Brown UUID?? |
346 | protected void DetachSingleAttachmentToInv(UUID itemID, IClientAPI remoteClient) | 378 | protected void DetachSingleAttachmentToInv(UUID itemID, IClientAPI remoteClient) |