aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine
diff options
context:
space:
mode:
authorMelanie2010-11-16 01:37:44 +0100
committerMelanie2010-11-16 01:36:26 +0000
commit5329e3b9b71237b298550590fa3812ff4759ec2a (patch)
tree7cfe1893224b73edc532d3f8b91d31855d0b8ba0 /OpenSim/Region/ScriptEngine
parentDiva needs a spanking! Serializing OldItemID breaks script state persistence ... (diff)
downloadopensim-SC_OLD-5329e3b9b71237b298550590fa3812ff4759ec2a.zip
opensim-SC_OLD-5329e3b9b71237b298550590fa3812ff4759ec2a.tar.gz
opensim-SC_OLD-5329e3b9b71237b298550590fa3812ff4759ec2a.tar.bz2
opensim-SC_OLD-5329e3b9b71237b298550590fa3812ff4759ec2a.tar.xz
Can't detach an object from within the script thread because it will throw. Use FireAndForget for that.
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs20
1 files changed, 14 insertions, 6 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index c251a49..cc3cf17 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -2983,17 +2983,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2983 2983
2984 if ((item.PermsMask & ScriptBaseClass.PERMISSION_ATTACH) != 0) 2984 if ((item.PermsMask & ScriptBaseClass.PERMISSION_ATTACH) != 0)
2985 { 2985 {
2986 SceneObjectGroup grp = m_host.ParentGroup;
2987 UUID itemID = grp.GetFromItemID();
2988
2989 ScenePresence presence = World.GetScenePresence(m_host.OwnerID);
2990
2991 IAttachmentsModule attachmentsModule = m_ScriptEngine.World.AttachmentsModule; 2986 IAttachmentsModule attachmentsModule = m_ScriptEngine.World.AttachmentsModule;
2992 if (attachmentsModule != null) 2987 if (attachmentsModule != null)
2993 attachmentsModule.ShowDetachInUserInventory(itemID, presence.ControllingClient); 2988 Util.FireAndForget(DetachWrapper, m_host);
2994 } 2989 }
2995 } 2990 }
2996 2991
2992 private void DetachWrapper(object o)
2993 {
2994 SceneObjectPart host = (SceneObjectPart)o;
2995
2996 SceneObjectGroup grp = host.ParentGroup;
2997 UUID itemID = grp.GetFromItemID();
2998 ScenePresence presence = World.GetScenePresence(host.OwnerID);
2999
3000 IAttachmentsModule attachmentsModule = m_ScriptEngine.World.AttachmentsModule;
3001 if (attachmentsModule != null)
3002 attachmentsModule.ShowDetachInUserInventory(itemID, presence.ControllingClient);
3003 }
3004
2997 public void llTakeCamera(string avatar) 3005 public void llTakeCamera(string avatar)
2998 { 3006 {
2999 m_host.AddScriptLPS(1); 3007 m_host.AddScriptLPS(1);