do not die tring to rez a item with a asset with uuid.Zero

This commit is contained in:
UbitUmarov
2020-09-20 22:19:27 +01:00
parent d256b29511
commit e4c7679e16
3 changed files with 23 additions and 24 deletions

View File

@@ -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,

View File

@@ -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;
}