From bf363c0ded9d99a929bb4d9ca3b3d2d8a92b7ede Mon Sep 17 00:00:00 2001 From: Charles Krinke Date: Wed, 13 Aug 2008 14:24:37 +0000 Subject: [PATCH] Mantis#1934. Thank you Tyre for a patch that: This patch implements the LSL script function llTeleportAgentHome() --- .../ScriptEngine/Common/LSL_BuiltIn_Commands.cs | 12 +++++++++++- .../Shared/Api/Implementation/LSL_Api.cs | 12 +++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index cef9cbfe8d..c2f8e96841 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs @@ -3028,7 +3028,17 @@ namespace OpenSim.Region.ScriptEngine.Common public void llTeleportAgentHome(string agent) { m_host.AddScriptLPS(1); - NotImplemented("llTeleportAgentHome"); + LLUUID agentId = new LLUUID(); + if (LLUUID.TryParse(agent, out agentId)) + { + ScenePresence presence = World.GetScenePresence(agentId); + if (presence != null) + { + // agent must be over the owners land + if (m_host.OwnerID == World.GetLandOwner(presence.AbsolutePosition.X, presence.AbsolutePosition.Y)) + World.TeleportClientHome(agentId, presence.ControllingClient); + } + } } public void llModifyLand(int action, int brush) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index a8f87b7428..0cd59549f4 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -2943,7 +2943,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llTeleportAgentHome(string agent) { m_host.AddScriptLPS(1); - NotImplemented("llTeleportAgentHome"); + LLUUID agentId = new LLUUID(); + if (LLUUID.TryParse(agent, out agentId)) + { + ScenePresence presence = World.GetScenePresence(agentId); + if (presence != null) + { + // agent must be over the owners land + if (m_host.OwnerID == World.GetLandOwner(presence.AbsolutePosition.X, presence.AbsolutePosition.Y)) + World.TeleportClientHome(agentId, presence.ControllingClient); + } + } } public void llModifyLand(int action, int brush)