Can't detach an object from within the script thread because it will throw.

Use FireAndForget for that.
avinationmerge
Melanie 2010-11-16 01:37:44 +01:00
parent 7a9c57a81e
commit c2ac5dc358
1 changed files with 14 additions and 6 deletions

View File

@ -3213,16 +3213,24 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if ((item.PermsMask & ScriptBaseClass.PERMISSION_ATTACH) != 0) if ((item.PermsMask & ScriptBaseClass.PERMISSION_ATTACH) != 0)
{ {
SceneObjectGroup grp = m_host.ParentGroup; IAttachmentsModule attachmentsModule = m_ScriptEngine.World.AttachmentsModule;
UUID itemID = grp.GetFromItemID(); if (attachmentsModule != null)
Util.FireAndForget(DetachWrapper, m_host);
}
}
ScenePresence presence = World.GetScenePresence(m_host.OwnerID); 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; IAttachmentsModule attachmentsModule = m_ScriptEngine.World.AttachmentsModule;
if (attachmentsModule != null) if (attachmentsModule != null)
attachmentsModule.ShowDetachInUserInventory(itemID, presence.ControllingClient); attachmentsModule.ShowDetachInUserInventory(itemID, presence.ControllingClient);
} }
}
public void llTakeCamera(string avatar) public void llTakeCamera(string avatar)
{ {