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)