mirror of
https://github.com/opensim/opensim.git
synced 2026-08-01 06:06:06 +08:00
Can't detach an object from within the script thread because it will throw.
Use FireAndForget for that.
This commit is contained in:
@@ -3213,17 +3213,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
if ((item.PermsMask & ScriptBaseClass.PERMISSION_ATTACH) != 0)
|
||||
{
|
||||
SceneObjectGroup grp = m_host.ParentGroup;
|
||||
UUID itemID = grp.GetFromItemID();
|
||||
|
||||
ScenePresence presence = World.GetScenePresence(m_host.OwnerID);
|
||||
|
||||
IAttachmentsModule attachmentsModule = m_ScriptEngine.World.AttachmentsModule;
|
||||
if (attachmentsModule != null)
|
||||
attachmentsModule.ShowDetachInUserInventory(itemID, presence.ControllingClient);
|
||||
Util.FireAndForget(DetachWrapper, m_host);
|
||||
}
|
||||
}
|
||||
|
||||
private void DetachWrapper(object o)
|
||||
{
|
||||
SceneObjectPart host = (SceneObjectPart)o;
|
||||
|
||||
SceneObjectGroup grp = host.ParentGroup;
|
||||
UUID itemID = grp.GetFromItemID();
|
||||
ScenePresence presence = World.GetScenePresence(host.OwnerID);
|
||||
|
||||
IAttachmentsModule attachmentsModule = m_ScriptEngine.World.AttachmentsModule;
|
||||
if (attachmentsModule != null)
|
||||
attachmentsModule.ShowDetachInUserInventory(itemID, presence.ControllingClient);
|
||||
}
|
||||
|
||||
public void llTakeCamera(string avatar)
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
Reference in New Issue
Block a user