return InventoryItemBase from AddSceneObjectAsAttachment()

bulletsim
Justin Clark-Casey (justincc) 2011-08-24 21:40:36 +01:00
parent 5eeee480d4
commit 801b7f18a7
1 changed files with 4 additions and 8 deletions

View File

@ -230,7 +230,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
itemID = group.GetFromItemID(); itemID = group.GetFromItemID();
if (itemID == UUID.Zero) if (itemID == UUID.Zero)
AddSceneObjectAsAttachment(sp.ControllingClient, group, out itemID); itemID = AddSceneObjectAsAttachment(sp.ControllingClient, group).ID;
ShowAttachInUserInventory(sp, AttachmentPt, itemID, group); ShowAttachInUserInventory(sp, AttachmentPt, itemID, group);
@ -664,14 +664,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
/// </summary> /// </summary>
/// <param name="remoteClient"></param> /// <param name="remoteClient"></param>
/// <param name="grp"></param> /// <param name="grp"></param>
/// <param name="itemID"></param> /// <returns>The user inventory item created that holds the attachment.</returns>
/// <returns></returns> private InventoryItemBase AddSceneObjectAsAttachment(IClientAPI remoteClient, SceneObjectGroup grp)
private UUID AddSceneObjectAsAttachment(IClientAPI remoteClient, SceneObjectGroup grp, out UUID itemID)
{ {
// m_log.DebugFormat("[SCENE]: Called AddSceneObjectAsAttachment for object {0} {1} for {2} {3} {4}", grp.Name, grp.LocalId, remoteClient.Name, remoteClient.AgentId, AgentId); // 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 Vector3 inventoryStoredPosition = new Vector3
(((grp.AbsolutePosition.X > (int)Constants.RegionSize) (((grp.AbsolutePosition.X > (int)Constants.RegionSize)
? Constants.RegionSize - 6 ? Constants.RegionSize - 6
@ -751,8 +748,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
m_dialogModule.SendAlertToUser(remoteClient, "Operation failed"); m_dialogModule.SendAlertToUser(remoteClient, "Operation failed");
} }
itemID = item.ID; return item;
return item.AssetID;
} }
} }
} }