diff options
author | Justin Clarke Casey | 2008-06-21 20:12:01 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-06-21 20:12:01 +0000 |
commit | e19a76377c561df939df512fdaeb6d4e830eb68a (patch) | |
tree | 34498d3a36542a1c286e729481a429422893e0ba /OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | |
parent | * Remove a bug I created in r5171 where taking an object would terminate the ... (diff) | |
download | opensim-SC_OLD-e19a76377c561df939df512fdaeb6d4e830eb68a.zip opensim-SC_OLD-e19a76377c561df939df512fdaeb6d4e830eb68a.tar.gz opensim-SC_OLD-e19a76377c561df939df512fdaeb6d4e830eb68a.tar.bz2 opensim-SC_OLD-e19a76377c561df939df512fdaeb6d4e830eb68a.tar.xz |
* Refactor: Fold sog.DeleteParts() functionality into existing sog.DeleteGroup()
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index 814db05..202e3b8 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | |||
@@ -931,12 +931,14 @@ namespace OpenSim.Region.Environment.Scenes | |||
931 | // code needs a redesign. | 931 | // code needs a redesign. |
932 | m_isDeleted = true; | 932 | m_isDeleted = true; |
933 | 933 | ||
934 | DetachFromBackup(this); | 934 | DetachFromBackup(this); |
935 | 935 | ||
936 | lock (m_parts) | 936 | lock (m_parts) |
937 | { | 937 | { |
938 | foreach (SceneObjectPart part in m_parts.Values) | 938 | foreach (SceneObjectPart part in m_parts.Values) |
939 | { | 939 | { |
940 | part.StopScripts(); | ||
941 | |||
940 | List<ScenePresence> avatars = Scene.GetScenePresences(); | 942 | List<ScenePresence> avatars = Scene.GetScenePresences(); |
941 | for (int i = 0; i < avatars.Count; i++) | 943 | for (int i = 0; i < avatars.Count; i++) |
942 | { | 944 | { |
@@ -948,6 +950,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
948 | avatars[i].ControllingClient.SendKillObject(m_regionHandle, part.LocalId); | 950 | avatars[i].ControllingClient.SendKillObject(m_regionHandle, part.LocalId); |
949 | } | 951 | } |
950 | } | 952 | } |
953 | |||
954 | m_rootPart = null; | ||
955 | m_parts.Clear(); | ||
951 | } | 956 | } |
952 | } | 957 | } |
953 | 958 | ||
@@ -968,23 +973,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
968 | } | 973 | } |
969 | } | 974 | } |
970 | 975 | ||
971 | /// <summary> | ||
972 | /// Delete all the parts in this group. | ||
973 | /// </summary> | ||
974 | public void DeleteParts() | ||
975 | { | ||
976 | lock (m_parts) | ||
977 | { | ||
978 | foreach (SceneObjectPart part in m_parts.Values) | ||
979 | { | ||
980 | part.StopScripts(); | ||
981 | } | ||
982 | |||
983 | m_rootPart = null; | ||
984 | m_parts.Clear(); | ||
985 | } | ||
986 | } | ||
987 | |||
988 | public void AddScriptLPS(int count) | 976 | public void AddScriptLPS(int count) |
989 | { | 977 | { |
990 | if (scriptScore + count >= float.MaxValue - count) | 978 | if (scriptScore + count >= float.MaxValue - count) |
@@ -1793,11 +1781,11 @@ namespace OpenSim.Region.Environment.Scenes | |||
1793 | 1781 | ||
1794 | m_scene.UnlinkSceneObject(objectGroup.UUID, true); | 1782 | m_scene.UnlinkSceneObject(objectGroup.UUID, true); |
1795 | 1783 | ||
1796 | // TODO Deleting the parts may cause problems later on if they have already | 1784 | // TODO Deleting the original group object may cause problems later on if they have already |
1797 | // made it into the update queue. However, sending out updates for those parts is now | 1785 | // made it into the update queue. However, sending out updates for those parts is now |
1798 | // spurious, so it would be good not to send them at some point. | 1786 | // spurious, so it would be good not to send them at some point. |
1799 | // The traffic caused is always going to be pretty minor, so it's not high priority | 1787 | // The traffic caused is always going to be pretty minor, so it's not high priority |
1800 | //objectGroup.DeleteParts(); | 1788 | //objectGroup.DeleteGroup(); |
1801 | 1789 | ||
1802 | ScheduleGroupForFullUpdate(); | 1790 | ScheduleGroupForFullUpdate(); |
1803 | } | 1791 | } |