diff options
Trigger changed event with CHANGED_TELEPORT when teleporting to another region.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 129b52d..b1216c5 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -2324,16 +2324,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
2324 | m_log.DebugFormat("[SCENE]: Problem adding scene object {0} in {1} ", sog.UUID, RegionInfo.RegionName); | 2324 | m_log.DebugFormat("[SCENE]: Problem adding scene object {0} in {1} ", sog.UUID, RegionInfo.RegionName); |
2325 | return false; | 2325 | return false; |
2326 | } | 2326 | } |
2327 | 2327 | ||
2328 | newObject.RootPart.ParentGroup.CreateScriptInstances(0, false, DefaultScriptEngine, 2); | 2328 | newObject.RootPart.ParentGroup.CreateScriptInstances(0, false, DefaultScriptEngine, GetStateSource(newObject)); |
2329 | 2329 | ||
2330 | newObject.ResumeScripts(); | 2330 | newObject.ResumeScripts(); |
2331 | 2331 | ||
2332 | // Do this as late as possible so that listeners have full access to the incoming object | 2332 | // Do this as late as possible so that listeners have full access to the incoming object |
2333 | EventManager.TriggerOnIncomingSceneObject(newObject); | 2333 | EventManager.TriggerOnIncomingSceneObject(newObject); |
2334 | 2334 | ||
2335 | TriggerChangedTeleport(newObject); | ||
2336 | |||
2337 | return true; | 2335 | return true; |
2338 | } | 2336 | } |
2339 | 2337 | ||
@@ -2441,7 +2439,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2441 | return true; | 2439 | return true; |
2442 | } | 2440 | } |
2443 | 2441 | ||
2444 | private void TriggerChangedTeleport(SceneObjectGroup sog) | 2442 | private int GetStateSource(SceneObjectGroup sog) |
2445 | { | 2443 | { |
2446 | ScenePresence sp = GetScenePresence(sog.OwnerID); | 2444 | ScenePresence sp = GetScenePresence(sog.OwnerID); |
2447 | 2445 | ||
@@ -2452,13 +2450,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
2452 | if (aCircuit != null && (aCircuit.teleportFlags != (uint)TeleportFlags.Default)) | 2450 | if (aCircuit != null && (aCircuit.teleportFlags != (uint)TeleportFlags.Default)) |
2453 | { | 2451 | { |
2454 | // This will get your attention | 2452 | // This will get your attention |
2455 | //m_log.Error("[XXX] Triggering "); | 2453 | //m_log.Error("[XXX] Triggering CHANGED_TELEPORT"); |
2456 | 2454 | ||
2457 | // Trigger CHANGED_TELEPORT | 2455 | return 5; // StateSource.Teleporting |
2458 | sp.Scene.EventManager.TriggerOnScriptChangedEvent(sog.LocalId, (uint)Changed.TELEPORT); | ||
2459 | } | 2456 | } |
2460 | |||
2461 | } | 2457 | } |
2458 | return 2; // StateSource.PrimCrossing | ||
2462 | } | 2459 | } |
2463 | 2460 | ||
2464 | #endregion | 2461 | #endregion |