aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs18
1 files changed, 17 insertions, 1 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
index 58ed554..f9c2142 100644
--- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
@@ -75,10 +75,26 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
75 m_scene.RegisterModuleInterface<IAttachmentsModule>(this); 75 m_scene.RegisterModuleInterface<IAttachmentsModule>(this);
76 76
77 if (Enabled) 77 if (Enabled)
78 {
78 m_scene.EventManager.OnNewClient += SubscribeToClientEvents; 79 m_scene.EventManager.OnNewClient += SubscribeToClientEvents;
80 m_scene.EventManager.OnStartScript += HandleScriptStateChange;
81 m_scene.EventManager.OnStopScript += HandleScriptStateChange;
82 }
79 83
80 // TODO: Should probably be subscribing to CloseClient too, but this doesn't yet give us IClientAPI 84 // TODO: Should probably be subscribing to CloseClient too, but this doesn't yet give us IClientAPI
81 } 85 }
86
87 /// <summary>
88 /// Listen for client triggered running state changes so that we can persist the script's object if necessary.
89 /// </summary>
90 /// <param name='localID'></param>
91 /// <param name='itemID'></param>
92 private void HandleScriptStateChange(uint localID, UUID itemID)
93 {
94 SceneObjectGroup sog = m_scene.GetGroupByPrim(localID);
95 if (sog != null && sog.IsAttachment)
96 sog.HasGroupChanged = true;
97 }
82 98
83 public void RemoveRegion(Scene scene) 99 public void RemoveRegion(Scene scene)
84 { 100 {
@@ -743,7 +759,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
743 // Remove the object from the scene so no more updates 759 // Remove the object from the scene so no more updates
744 // are sent. Doing this before the below changes will ensure 760 // are sent. Doing this before the below changes will ensure
745 // updates can't cause "HUD artefacts" 761 // updates can't cause "HUD artefacts"
746 m_scene.DeleteSceneObject(so, false, false); 762 m_scene.DeleteSceneObject(so, false);
747 763
748 // Prepare sog for storage 764 // Prepare sog for storage
749 so.AttachedAvatar = UUID.Zero; 765 so.AttachedAvatar = UUID.Zero;