aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/Environment/Scenes/InnerScene.cs2
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.Inventory.cs31
2 files changed, 15 insertions, 18 deletions
diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs
index 1b0ea6f..34224a7 100644
--- a/OpenSim/Region/Environment/Scenes/InnerScene.cs
+++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs
@@ -547,8 +547,6 @@ namespace OpenSim.Region.Environment.Scenes
547 if (group.GetFromAssetID() == UUID.Zero) 547 if (group.GetFromAssetID() == UUID.Zero)
548 { 548 {
549 m_parentScene.attachObjectAssetStore(remoteClient, group, remoteClient.AgentId); 549 m_parentScene.attachObjectAssetStore(remoteClient, group, remoteClient.AgentId);
550
551 // sets assetID so client can show asset as 'attached' in inventory
552 } 550 }
553 group.AttachToAgent(remoteClient.AgentId, AttachmentPt, attachPos); 551 group.AttachToAgent(remoteClient.AgentId, AttachmentPt, attachPos);
554 // In case it is later dropped again, don't let 552 // In case it is later dropped again, don't let
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
index a9aaf4d..3414b26 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
@@ -1778,24 +1778,23 @@ namespace OpenSim.Region.Environment.Scenes
1778 1778
1779 public UUID attachObjectAssetStore(IClientAPI remoteClient, SceneObjectGroup grp, UUID AgentId) 1779 public UUID attachObjectAssetStore(IClientAPI remoteClient, SceneObjectGroup grp, UUID AgentId)
1780 { 1780 {
1781 SceneObjectGroup objectGroup = grp; 1781 if (grp != null)
1782 if (objectGroup != null)
1783 { 1782 {
1784 string sceneObjectXml = objectGroup.ToXmlString(); 1783 string sceneObjectXml = grp.ToXmlString();
1785 1784
1786 CachedUserInfo userInfo = 1785 CachedUserInfo userInfo =
1787 CommsManager.UserProfileCacheService.GetUserDetails(AgentId); 1786 CommsManager.UserProfileCacheService.GetUserDetails(AgentId);
1788 if (userInfo != null) 1787 if (userInfo != null)
1789 { 1788 {
1790 AssetBase asset = CreateAsset( 1789 AssetBase asset = CreateAsset(
1791 objectGroup.GetPartName(objectGroup.LocalId), 1790 grp.GetPartName(grp.LocalId),
1792 objectGroup.GetPartDescription(objectGroup.LocalId), 1791 grp.GetPartDescription(grp.LocalId),
1793 (sbyte)AssetType.Object, 1792 (sbyte)AssetType.Object,
1794 Utils.StringToBytes(sceneObjectXml)); 1793 Utils.StringToBytes(sceneObjectXml));
1795 AssetCache.AddAsset(asset); 1794 AssetCache.AddAsset(asset);
1796 1795
1797 InventoryItemBase item = new InventoryItemBase(); 1796 InventoryItemBase item = new InventoryItemBase();
1798 item.Creator = objectGroup.RootPart.CreatorID; 1797 item.Creator = grp.RootPart.CreatorID;
1799 item.Owner = remoteClient.AgentId; 1798 item.Owner = remoteClient.AgentId;
1800 item.ID = UUID.Random(); 1799 item.ID = UUID.Random();
1801 item.AssetID = asset.FullID; 1800 item.AssetID = asset.FullID;
@@ -1806,22 +1805,23 @@ namespace OpenSim.Region.Environment.Scenes
1806 1805
1807 item.Folder = UUID.Zero; // Objects folder! 1806 item.Folder = UUID.Zero; // Objects folder!
1808 1807
1809 if ((remoteClient.AgentId != objectGroup.RootPart.OwnerID) && ExternalChecks.ExternalChecksPropagatePermissions()) 1808 if ((remoteClient.AgentId != grp.RootPart.OwnerID) && ExternalChecks.ExternalChecksPropagatePermissions())
1810 { 1809 {
1811 item.BasePermissions = objectGroup.RootPart.NextOwnerMask; 1810 item.BasePermissions = grp.RootPart.NextOwnerMask;
1812 item.CurrentPermissions = objectGroup.RootPart.NextOwnerMask; 1811 item.CurrentPermissions = grp.RootPart.NextOwnerMask;
1813 item.NextPermissions = objectGroup.RootPart.NextOwnerMask; 1812 item.NextPermissions = grp.RootPart.NextOwnerMask;
1814 item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask & objectGroup.RootPart.NextOwnerMask; 1813 item.EveryOnePermissions = grp.RootPart.EveryoneMask & grp.RootPart.NextOwnerMask;
1815 } 1814 }
1816 else 1815 else
1817 { 1816 {
1818 item.BasePermissions = objectGroup.RootPart.BaseMask; 1817 item.BasePermissions = grp.RootPart.BaseMask;
1819 item.CurrentPermissions = objectGroup.RootPart.OwnerMask; 1818 item.CurrentPermissions = grp.RootPart.OwnerMask;
1820 item.NextPermissions = objectGroup.RootPart.NextOwnerMask; 1819 item.NextPermissions = grp.RootPart.NextOwnerMask;
1821 item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask; 1820 item.EveryOnePermissions = grp.RootPart.EveryoneMask;
1822 } 1821 }
1823 item.CreationDate = Util.UnixTimeSinceEpoch(); 1822 item.CreationDate = Util.UnixTimeSinceEpoch();
1824 1823
1824 // sets assetID so client can show asset as 'attached' in inventory
1825 grp.SetFromAssetID(item.ID); 1825 grp.SetFromAssetID(item.ID);
1826 1826
1827 userInfo.AddItem(item); 1827 userInfo.AddItem(item);
@@ -1832,7 +1832,6 @@ namespace OpenSim.Region.Environment.Scenes
1832 return UUID.Zero; 1832 return UUID.Zero;
1833 } 1833 }
1834 return UUID.Zero; 1834 return UUID.Zero;
1835
1836 } 1835 }
1837 1836
1838 /// <summary> 1837 /// <summary>