mirror of
https://github.com/opensim/opensim.git
synced 2026-08-10 11:33:28 +08:00
mantis 9036: do not allow attach of coalesced inventory assets
This commit is contained in:
@@ -115,6 +115,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
return;
|
||||
|
||||
m_invAccessModule = m_scene.RequestModuleInterface<IInventoryAccessModule>();
|
||||
if (m_invAccessModule is null)
|
||||
{
|
||||
Enabled = false;
|
||||
m_scene.UnregisterModuleInterface<IAttachmentsModule>(this);
|
||||
m_scene.EventManager.OnNewClient -= SubscribeToClientEvents;
|
||||
m_scene.EventManager.OnStartScript -= OnScriptStarted;
|
||||
m_scene.EventManager.OnStopScript -= OnScriptStopped;
|
||||
m_log.WarnFormat("[ATTACHMENTS MODULE]: InventoryService unvailable!. Module disabled");
|
||||
return;
|
||||
}
|
||||
|
||||
m_regionConsole = scene.RequestModuleInterface<IRegionConsole>();
|
||||
if (m_regionConsole is not null)
|
||||
{
|
||||
|
||||
@@ -315,9 +315,16 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment)
|
||||
{
|
||||
InventoryItemBase item = m_Scene.InventoryService.GetItem(remoteClient.AgentId, itemID);
|
||||
if (item == null || item.AssetID.IsZero())
|
||||
if (item is null || item.AssetID.IsZero())
|
||||
return null;
|
||||
|
||||
if (attachment && (item.Flags & (uint)InventoryItemFlags.ObjectHasMultipleItems) != 0)
|
||||
{
|
||||
if (remoteClient is not null && remoteClient.IsActive)
|
||||
remoteClient.SendAlertMessage("You can't attach multiple objects to one spot");
|
||||
return null;
|
||||
}
|
||||
|
||||
string userAssetServer;
|
||||
if (IsForeignUser(remoteClient.AgentId, out userAssetServer))
|
||||
{
|
||||
|
||||
@@ -923,9 +923,16 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
// m_log.DebugFormat("[INVENTORY ACCESS MODULE]: RezObject for {0}, item {1}", remoteClient.Name, itemID);
|
||||
InventoryItemBase item = m_Scene.InventoryService.GetItem(remoteClient.AgentId, itemID);
|
||||
|
||||
if (item == null)
|
||||
if (item is null)
|
||||
return null;
|
||||
|
||||
if (attachment && (item.Flags & (uint)InventoryItemFlags.ObjectHasMultipleItems) != 0)
|
||||
{
|
||||
if (remoteClient is not null && remoteClient.IsActive)
|
||||
remoteClient.SendAlertMessage("You can't attach multiple objects to one spot");
|
||||
return null;
|
||||
}
|
||||
|
||||
item.Owner = remoteClient.AgentId;
|
||||
|
||||
return RezObject(
|
||||
|
||||
Reference in New Issue
Block a user