diff options
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneGraph.cs | 4 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs | 3 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs | 17 |
3 files changed, 11 insertions, 13 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 5752a88..0e0999a 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs | |||
@@ -512,8 +512,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
512 | objatt.HasGroupChanged = true; | 512 | objatt.HasGroupChanged = true; |
513 | 513 | ||
514 | // Fire after attach, so we don't get messy perms dialogs | 514 | // Fire after attach, so we don't get messy perms dialogs |
515 | // | 515 | // 3 == AttachedRez |
516 | objatt.CreateScriptInstances(0, true, m_parentScene.DefaultScriptEngine, 0); | 516 | objatt.CreateScriptInstances(0, true, m_parentScene.DefaultScriptEngine, 3); |
517 | } | 517 | } |
518 | return objatt; | 518 | return objatt; |
519 | } | 519 | } |
diff --git a/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs b/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs index c2fce2f..f49aea8 100644 --- a/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs | |||
@@ -40,7 +40,8 @@ namespace OpenSim.Region.ScriptEngine.Interfaces | |||
40 | { | 40 | { |
41 | NewRez = 0, | 41 | NewRez = 0, |
42 | PrimCrossing = 1, | 42 | PrimCrossing = 1, |
43 | ScriptedRez = 2 | 43 | ScriptedRez = 2, |
44 | AttachedRez = 3 | ||
44 | } | 45 | } |
45 | 46 | ||
46 | public interface IScriptWorkItem | 47 | public interface IScriptWorkItem |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index 586f926..8168300 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs | |||
@@ -89,8 +89,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
89 | private long m_eventDelayTicks = 0; | 89 | private long m_eventDelayTicks = 0; |
90 | private long m_nextEventTimeTicks = 0; | 90 | private long m_nextEventTimeTicks = 0; |
91 | private bool m_startOnInit = true; | 91 | private bool m_startOnInit = true; |
92 | private bool m_isAttachment = false; | 92 | private UUID m_AttachedAvatar = UUID.Zero; |
93 | private UUID m_attachedAvatar = UUID.Zero; | ||
94 | private StateSource m_stateSource; | 93 | private StateSource m_stateSource; |
95 | private bool m_postOnRez; | 94 | private bool m_postOnRez; |
96 | private bool m_startedFromSavedState = false; | 95 | private bool m_startedFromSavedState = false; |
@@ -234,8 +233,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
234 | m_MaxScriptQueue = maxScriptQueue; | 233 | m_MaxScriptQueue = maxScriptQueue; |
235 | m_stateSource = stateSource; | 234 | m_stateSource = stateSource; |
236 | m_postOnRez = postOnRez; | 235 | m_postOnRez = postOnRez; |
237 | m_isAttachment = part.IsAttachment; | 236 | m_AttachedAvatar = part.AttachedAvatar; |
238 | m_attachedAvatar = part.AttachedAvatar; | ||
239 | m_RegionID = part.ParentGroup.Scene.RegionInfo.RegionID; | 237 | m_RegionID = part.ParentGroup.Scene.RegionInfo.RegionID; |
240 | 238 | ||
241 | if (part != null) | 239 | if (part != null) |
@@ -383,13 +381,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
383 | new Object[] {new LSL_Types.LSLInteger(m_StartParam)}, new DetectParams[0])); | 381 | new Object[] {new LSL_Types.LSLInteger(m_StartParam)}, new DetectParams[0])); |
384 | } | 382 | } |
385 | 383 | ||
386 | if (m_isAttachment) | 384 | if (m_stateSource == StateSource.AttachedRez) |
387 | { | 385 | { |
388 | PostEvent(new EventParams("attach", | 386 | PostEvent(new EventParams("attach", |
389 | new object[] { new LSL_Types.LSLString(m_attachedAvatar.ToString()) }, new DetectParams[0])); | 387 | new object[] { new LSL_Types.LSLString(m_AttachedAvatar.ToString()) }, new DetectParams[0])); |
390 | } | 388 | } |
391 | 389 | else if (m_stateSource == StateSource.NewRez) | |
392 | if (m_stateSource == StateSource.NewRez) | ||
393 | { | 390 | { |
394 | // m_log.Debug("[Script] Posted changed(CHANGED_REGION_RESTART) to script"); | 391 | // m_log.Debug("[Script] Posted changed(CHANGED_REGION_RESTART) to script"); |
395 | PostEvent(new EventParams("changed", | 392 | PostEvent(new EventParams("changed", |
@@ -413,10 +410,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
413 | new Object[] {new LSL_Types.LSLInteger(m_StartParam)}, new DetectParams[0])); | 410 | new Object[] {new LSL_Types.LSLInteger(m_StartParam)}, new DetectParams[0])); |
414 | } | 411 | } |
415 | 412 | ||
416 | if (m_isAttachment) | 413 | if (m_stateSource == StateSource.AttachedRez) |
417 | { | 414 | { |
418 | PostEvent(new EventParams("attach", | 415 | PostEvent(new EventParams("attach", |
419 | new object[] { new LSL_Types.LSLString(m_attachedAvatar.ToString()) }, new DetectParams[0])); | 416 | new object[] { new LSL_Types.LSLString(m_AttachedAvatar.ToString()) }, new DetectParams[0])); |
420 | } | 417 | } |
421 | 418 | ||
422 | } | 419 | } |