diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index a122217d85..8889977e2f 100755 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs @@ -1241,7 +1241,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments return null; } - if (itemID != UUID.Zero) + bool ItemIDNotZero = itemID != UUID.Zero; + + if (ItemIDNotZero) objatt = m_invAccessModule.RezObject(sp.ControllingClient, itemID, rezGroupID, Vector3.Zero, Vector3.Zero, UUID.Zero, (byte)1, true, false, false, sp.UUID, true); @@ -1252,13 +1254,21 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments if (objatt == null) { - m_log.WarnFormat( - "[ATTACHMENTS MODULE]: did not attached item {0} to avatar {1} at point {2}", - itemID, sp.Name, attachmentPt); + if(ItemIDNotZero) + { + m_log.WarnFormat("[ATTACHMENTS MODULE]: did not attach item {0} to avatar {1} at point {2}", + itemID, sp.Name, attachmentPt); + } + else + { + m_log.WarnFormat("[ATTACHMENTS MODULE]: did not attach item with asset {0} to avatar {1} at point {2}", + assetID, sp.Name, attachmentPt); + } return null; } - else if (itemID == UUID.Zero) + + if (!ItemIDNotZero) { // We need to have a FromItemID for multiple attachments on a single attach point to appear. This is // true on Singularity 1.8.5 and quite possibly other viewers as well. As NPCs don't have an inventory diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs index ee67ddc618..bfce891620 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs @@ -321,25 +321,15 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection, bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment) { - //m_log.DebugFormat("[HGScene]: RezObject itemID={0} fromTaskID={1}", itemID, fromTaskID); - - //if (fromTaskID.Equals(UUID.Zero)) - //{ InventoryItemBase item = m_Scene.InventoryService.GetItem(remoteClient.AgentId, itemID); - //if (item == null) - //{ // Fetch the item - // item = new InventoryItemBase(); - // item.Owner = remoteClient.AgentId; - // item.ID = itemID; - // item = m_assMapper.Get(item, userInfo.RootFolder.ID, userInfo); - //} - string userAssetServer = string.Empty; - if (item != null && IsForeignUser(remoteClient.AgentId, out userAssetServer)) + if (item == null || item.AssetID == UUID.Zero) + return null; + + string userAssetServer; + if (IsForeignUser(remoteClient.AgentId, out userAssetServer)) { m_assMapper.Get(item.AssetID, remoteClient.AgentId, userAssetServer); - } - //} // OK, we're done fetching. Pass it up to the default RezObject SceneObjectGroup sog = base.RezObject(remoteClient, itemID, groupID, RayEnd, RayStart, RayTargetID, BypassRayCast, RayEndIsIntersection, diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index 4fdaa76697..0481b4ac2b 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs @@ -885,9 +885,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess InventoryItemBase item = m_Scene.InventoryService.GetItem(remoteClient.AgentId, itemID); if (item == null) - { return null; - } item.Owner = remoteClient.AgentId; @@ -915,8 +913,10 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess byte BypassRayCast, bool RayEndIsIntersection, bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment) { - AssetBase rezAsset = m_Scene.AssetService.Get(assetID.ToString()); + if(assetID == UUID.Zero) + return null; + AssetBase rezAsset = m_Scene.AssetService.Get(assetID.ToString()); if (rezAsset == null) { if (item != null) @@ -933,7 +933,6 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess assetID, remoteClient.Name); remoteClient.SendAgentAlertMessage(string.Format("Unable to rez: could not find asset {0}.", assetID), false); } - return null; }