Set attachments to group and resume scripts for XmlRpcGroups

This commit is contained in:
lickx
2025-03-24 06:01:21 +01:00
parent bb6cf5e9fe
commit 2d1573fc4f

View File

@@ -824,6 +824,21 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
UUID agentID = GetRequestingAgentID(remoteClient);
m_groupData.SetAgentActiveGroup(agentID, agentID, groupID);
ScenePresence sp = ((Scene)(remoteClient.Scene)).GetScenePresence(remoteClient.AgentId);
List<SceneObjectGroup> attachments = sp.GetAttachments();
foreach(SceneObjectGroup so in attachments)
{
//m_log.DebugFormat("[GROUPS MODULE]: Setting new group and checking scripts to run in attachment {0} for {1}", so.Name, so.OwnerID);
so.SetGroup(groupID, remoteClient);
if (so.ContainsScripts() && so.RunningScriptCount() == 0)
{
so.RootPart.ParentGroup.CreateScriptInstances(
0, false, sp.Scene.DefaultScriptEngine, sp.GetStateSource());
so.ResumeScripts();
}
}
// llClientView does this
SendAgentGroupDataUpdate(remoteClient, true);
}