From 801b7f18a7170b3df7f678e927122125f1c16eba Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Wed, 24 Aug 2011 21:40:36 +0100
Subject: return InventoryItemBase from AddSceneObjectAsAttachment()
---
.../CoreModules/Avatar/Attachments/AttachmentsModule.cs | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
(limited to 'OpenSim/Region/CoreModules')
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
index 5661254..928d43f 100644
--- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
@@ -230,7 +230,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
itemID = group.GetFromItemID();
if (itemID == UUID.Zero)
- AddSceneObjectAsAttachment(sp.ControllingClient, group, out itemID);
+ itemID = AddSceneObjectAsAttachment(sp.ControllingClient, group).ID;
ShowAttachInUserInventory(sp, AttachmentPt, itemID, group);
@@ -664,14 +664,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
///
///
///
- ///
- ///
- private UUID AddSceneObjectAsAttachment(IClientAPI remoteClient, SceneObjectGroup grp, out UUID itemID)
+ /// The user inventory item created that holds the attachment.
+ private InventoryItemBase AddSceneObjectAsAttachment(IClientAPI remoteClient, SceneObjectGroup grp)
{
// m_log.DebugFormat("[SCENE]: Called AddSceneObjectAsAttachment for object {0} {1} for {2} {3} {4}", grp.Name, grp.LocalId, remoteClient.Name, remoteClient.AgentId, AgentId);
- itemID = UUID.Zero;
-
Vector3 inventoryStoredPosition = new Vector3
(((grp.AbsolutePosition.X > (int)Constants.RegionSize)
? Constants.RegionSize - 6
@@ -751,8 +748,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
m_dialogModule.SendAlertToUser(remoteClient, "Operation failed");
}
- itemID = item.ID;
- return item.AssetID;
+ return item;
}
}
}
--
cgit v1.1