aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.Inventory.cs43
1 files changed, 43 insertions, 0 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
index 0148d76..784d04c 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
@@ -2316,5 +2316,48 @@ namespace OpenSim.Region.Environment.Scenes
2316// 2316//
2317// imod.TestFunction(); 2317// imod.TestFunction();
2318// } 2318// }
2319
2320 public void RezSingleAttachment(IClientAPI remoteClient, LLUUID itemID,
2321 uint AttachmentPt, uint ItemFlags, uint NextOwnerMask)
2322 {
2323 SceneObjectGroup att = m_innerScene.RezSingleAttachment(remoteClient, itemID, AttachmentPt, ItemFlags, NextOwnerMask);
2324
2325 if (att == null)
2326 {
2327 DetachSingleAttachmentToInv(itemID, remoteClient);
2328 return;
2329 }
2330
2331 if (att.RootPart != null)
2332 AttachmentPt = att.RootPart.AttachmentPoint;
2333
2334 ScenePresence presence;
2335 if(TryGetAvatar(remoteClient.AgentId, out presence))
2336 {
2337 presence.Appearance.SetAttachment((int)AttachmentPt, itemID, att.GetFromAssetID());
2338 IAvatarFactory ava = RequestModuleInterface<IAvatarFactory>();
2339 if(ava != null)
2340 {
2341 ava.UpdateDatabase(remoteClient.AgentId, presence.Appearance);
2342 }
2343
2344 }
2345 }
2346
2347 public void DetachSingleAttachmentToInv(LLUUID itemID, IClientAPI remoteClient)
2348 {
2349 ScenePresence presence;
2350 if(TryGetAvatar(remoteClient.AgentId, out presence))
2351 {
2352 presence.Appearance.DetachAttachment(itemID);
2353 IAvatarFactory ava = RequestModuleInterface<IAvatarFactory>();
2354 if(ava != null)
2355 {
2356 ava.UpdateDatabase(remoteClient.AgentId, presence.Appearance);
2357 }
2358
2359 }
2360 m_innerScene.DetachSingleAttachmentToInv(itemID, remoteClient);
2361 }
2319 } 2362 }
2320} 2363}