Allow 100ms for scripts to run attach(NULL_KEY) on detach

avinationmerge
root 2009-12-22 03:22:33 +01:00
parent fa0621b486
commit 69b551c516
1 changed files with 12 additions and 0 deletions

View File

@ -542,6 +542,18 @@ namespace OpenSim.Region.Framework.Scenes
if (group.GetFromItemID() == itemID)
{
m_parentScene.SendAttachEvent(group.LocalId, itemID, UUID.Zero);
bool hasScripts = false;
foreach (SceneObjectPart part in group.Children)
{
if (part..Inventory.ContainsScripts())
{
hasScripts = true;
break;
}
}
if (hasScripts) // Allow the object to execute the attach(NULL_KEY) event
System.Threading.Thread.Sleep(100);
group.DetachToInventoryPrep();
m_log.Debug("[DETACH]: Saving attachpoint: " +
((uint)group.GetAttachmentPoint()).ToString());