aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorCharles Krinke2008-08-13 14:24:37 +0000
committerCharles Krinke2008-08-13 14:24:37 +0000
commitbf363c0ded9d99a929bb4d9ca3b3d2d8a92b7ede (patch)
tree02d84d781ec06c305984b8ac94dffbf29d39c2eb
parentmantis#1927. Thank you kindly, Leaf for a patch that: (diff)
downloadopensim-SC-bf363c0ded9d99a929bb4d9ca3b3d2d8a92b7ede.zip
opensim-SC-bf363c0ded9d99a929bb4d9ca3b3d2d8a92b7ede.tar.gz
opensim-SC-bf363c0ded9d99a929bb4d9ca3b3d2d8a92b7ede.tar.bz2
opensim-SC-bf363c0ded9d99a929bb4d9ca3b3d2d8a92b7ede.tar.xz
Mantis#1934. Thank you Tyre for a patch that:
This patch implements the LSL script function llTeleportAgentHome()
-rw-r--r--OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs12
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs12
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 cef9cbf..c2f8e96 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
3028 public void llTeleportAgentHome(string agent) 3028 public void llTeleportAgentHome(string agent)
3029 { 3029 {
3030 m_host.AddScriptLPS(1); 3030 m_host.AddScriptLPS(1);
3031 NotImplemented("llTeleportAgentHome"); 3031 LLUUID agentId = new LLUUID();
3032 if (LLUUID.TryParse(agent, out agentId))
3033 {
3034 ScenePresence presence = World.GetScenePresence(agentId);
3035 if (presence != null)
3036 {
3037 // agent must be over the owners land
3038 if (m_host.OwnerID == World.GetLandOwner(presence.AbsolutePosition.X, presence.AbsolutePosition.Y))
3039 World.TeleportClientHome(agentId, presence.ControllingClient);
3040 }
3041 }
3032 } 3042 }
3033 3043
3034 public void llModifyLand(int action, int brush) 3044 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 a8f87b7..0cd5954 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
2943 public void llTeleportAgentHome(string agent) 2943 public void llTeleportAgentHome(string agent)
2944 { 2944 {
2945 m_host.AddScriptLPS(1); 2945 m_host.AddScriptLPS(1);
2946 NotImplemented("llTeleportAgentHome"); 2946 LLUUID agentId = new LLUUID();
2947 if (LLUUID.TryParse(agent, out agentId))
2948 {
2949 ScenePresence presence = World.GetScenePresence(agentId);
2950 if (presence != null)
2951 {
2952 // agent must be over the owners land
2953 if (m_host.OwnerID == World.GetLandOwner(presence.AbsolutePosition.X, presence.AbsolutePosition.Y))
2954 World.TeleportClientHome(agentId, presence.ControllingClient);
2955 }
2956 }
2947 } 2957 }
2948 2958
2949 public void llModifyLand(int action, int brush) 2959 public void llModifyLand(int action, int brush)