From a8e40bed52d9db6d099843ffb796cae266064c14 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Mon, 17 Nov 2008 21:44:09 +0000 Subject: Set group on newly rezzed objects to the rezzer's (or rezzing object's) group --- .../Region/Environment/Scenes/Scene.Inventory.cs | 3 +++ .../Region/Environment/Scenes/SceneObjectGroup.cs | 1 + .../Scenes/SceneObjectPart.Inventory.cs | 22 ++++++++++++++++++++++ .../Region/Environment/Scenes/SceneObjectPart.cs | 3 ++- 4 files changed, 28 insertions(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index 0c217dd..e46b13c 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs @@ -2031,6 +2031,7 @@ namespace OpenSim.Region.Environment.Scenes List partList = new List(group.Children.Values); + group.SetGroup(remoteClient.ActiveGroupId, remoteClient); if (rootPart.OwnerID != item.Owner) { //Need to kill the for sale here @@ -2148,6 +2149,8 @@ namespace OpenSim.Region.Environment.Scenes List partList = new List(group.Children.Values); + group.SetGroup(sourcePart.GroupID, null); + if (rootPart.OwnerID != item.OwnerID) { if (ExternalChecks.ExternalChecksPropagatePermissions()) diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index bf430b9..380557b 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs @@ -2825,6 +2825,7 @@ namespace OpenSim.Region.Environment.Scenes foreach (SceneObjectPart part in m_parts.Values) { part.SetGroup(GroupID, client); + part.ChangeInventoryGroup(GroupID); } HasGroupChanged = true; diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs index 4209e4a..ba638e5 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs @@ -123,6 +123,28 @@ namespace OpenSim.Region.Environment.Scenes } } + public void ChangeInventoryGroup(UUID groupID) + { + lock (TaskInventory) + { + if (0 == TaskInventory.Count) + { + return; + } + + HasInventoryChanged = true; + ParentGroup.HasGroupChanged = true; + IList items = new List(TaskInventory.Values); + foreach (TaskInventoryItem item in items) + { + if (groupID != item.GroupID) + { + item.GroupID = groupID; + } + } + } + } + /// /// Start all the scripts contained in this prim's inventory /// diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index deb7f89..c7862ec 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs @@ -2304,7 +2304,8 @@ if (m_shape != null) { public void SetGroup(UUID groupID, IClientAPI client) { _groupID = groupID; - GetProperties(client); + if (client != null) + GetProperties(client); m_updateFlag = 2; } -- cgit v1.1