diff options
author | Diva Canto | 2011-04-29 15:52:06 -0700 |
---|---|---|
committer | Diva Canto | 2011-04-29 15:52:06 -0700 |
commit | 0d49611f6db017da16b6099c440b6c1e2b2218b9 (patch) | |
tree | eb25beec8d2c8766e84956b9ba95c2a3fc046e85 | |
parent | Minor correction to yesterday's changes. Make normal prim crossing (no attach... (diff) | |
download | opensim-SC-0d49611f6db017da16b6099c440b6c1e2b2218b9.zip opensim-SC-0d49611f6db017da16b6099c440b6c1e2b2218b9.tar.gz opensim-SC-0d49611f6db017da16b6099c440b6c1e2b2218b9.tar.bz2 opensim-SC-0d49611f6db017da16b6099c440b6c1e2b2218b9.tar.xz |
Remove the scripts of the attachments in the departing region and recreate them if fail.
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 12 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 2 |
2 files changed, 12 insertions, 2 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 1054785..b985fbb 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -479,7 +479,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
479 | 479 | ||
480 | // Fail. Reset it back | 480 | // Fail. Reset it back |
481 | sp.IsChildAgent = false; | 481 | sp.IsChildAgent = false; |
482 | 482 | ReInstantiateScripts(sp); | |
483 | ResetFromTransit(sp.UUID); | 483 | ResetFromTransit(sp.UUID); |
484 | 484 | ||
485 | EnableChildAgents(sp); | 485 | EnableChildAgents(sp); |
@@ -930,6 +930,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
930 | if (!WaitForCallback(agent.UUID)) | 930 | if (!WaitForCallback(agent.UUID)) |
931 | { | 931 | { |
932 | m_log.Debug("[ENTITY TRANSFER MODULE]: Callback never came in crossing agent"); | 932 | m_log.Debug("[ENTITY TRANSFER MODULE]: Callback never came in crossing agent"); |
933 | ReInstantiateScripts(agent); | ||
933 | ResetFromTransit(agent.UUID); | 934 | ResetFromTransit(agent.UUID); |
934 | 935 | ||
935 | // Yikes! We should just have a ref to scene here. | 936 | // Yikes! We should just have a ref to scene here. |
@@ -1756,7 +1757,14 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1756 | return false; | 1757 | return false; |
1757 | } | 1758 | } |
1758 | 1759 | ||
1759 | 1760 | protected void ReInstantiateScripts(ScenePresence sp) | |
1761 | { | ||
1762 | sp.Attachments.ForEach(delegate(SceneObjectGroup sog) | ||
1763 | { | ||
1764 | sog.CreateScriptInstances(0, false, sp.Scene.DefaultScriptEngine, 0); | ||
1765 | sog.ResumeScripts(); | ||
1766 | }); | ||
1767 | } | ||
1760 | #endregion | 1768 | #endregion |
1761 | 1769 | ||
1762 | } | 1770 | } |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index fe4a7d1..9b9d9da 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -3113,6 +3113,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
3113 | ((SceneObjectGroup)clone).RootPart.IsAttachment = false; | 3113 | ((SceneObjectGroup)clone).RootPart.IsAttachment = false; |
3114 | cAgent.AttachmentObjects.Add(clone); | 3114 | cAgent.AttachmentObjects.Add(clone); |
3115 | cAgent.AttachmentObjectStates.Add(sog.GetStateSnapshot()); | 3115 | cAgent.AttachmentObjectStates.Add(sog.GetStateSnapshot()); |
3116 | // Let's remove the scripts of the original object here | ||
3117 | sog.RemoveScriptInstances(true); | ||
3116 | } | 3118 | } |
3117 | } | 3119 | } |
3118 | } | 3120 | } |