aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs19
1 files changed, 13 insertions, 6 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index 3ddd79b..e1c837e 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -703,9 +703,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
703 == World.LandChannel.GetLandObject( 703 == World.LandChannel.GetLandObject(
704 presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID) 704 presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID)
705 { 705 {
706 World.RequestTeleportLocation(presence.ControllingClient, regionName, 706 // We will launch the teleport on a new thread so that when the script threads are terminated
707 new Vector3((float)position.x, (float)position.y, (float)position.z), 707 // before teleport in ScriptInstance.GetXMLState(), we don't end up aborting the one doing the teleporting.
708 new Vector3((float)lookat.x, (float)lookat.y, (float)lookat.z), (uint)TPFlags.ViaLocation); 708 Util.FireAndForget(
709 o => World.RequestTeleportLocation(presence.ControllingClient, regionName,
710 new Vector3((float)position.x, (float)position.y, (float)position.z),
711 new Vector3((float)lookat.x, (float)lookat.y, (float)lookat.z), (uint)TPFlags.ViaLocation));
709 712
710 ScriptSleep(5000); 713 ScriptSleep(5000);
711 } 714 }
@@ -741,9 +744,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
741 == World.LandChannel.GetLandObject( 744 == World.LandChannel.GetLandObject(
742 presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID) 745 presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID)
743 { 746 {
744 World.RequestTeleportLocation(presence.ControllingClient, regionHandle, 747 // We will launch the teleport on a new thread so that when the script threads are terminated
745 new Vector3((float)position.x, (float)position.y, (float)position.z), 748 // before teleport in ScriptInstance.GetXMLState(), we don't end up aborting the one doing the teleporting.
746 new Vector3((float)lookat.x, (float)lookat.y, (float)lookat.z), (uint)TPFlags.ViaLocation); 749 Util.FireAndForget(
750 o => World.RequestTeleportLocation(presence.ControllingClient, regionHandle,
751 new Vector3((float)position.x, (float)position.y, (float)position.z),
752 new Vector3((float)lookat.x, (float)lookat.y, (float)lookat.z), (uint)TPFlags.ViaLocation));
753
747 ScriptSleep(5000); 754 ScriptSleep(5000);
748 } 755 }
749 } 756 }