mirror of
https://github.com/opensim/opensim.git
synced 2026-08-07 09:45:47 +08:00
do not die tring to rez a item with a asset with uuid.Zero
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user