aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs17
1 files changed, 14 insertions, 3 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index b0a99f3..55e370f 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -2976,6 +2976,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2976 } 2976 }
2977 IClientAPI client = World.GetScenePresence(m_host.TaskInventory[invItemID].PermsGranter).ControllingClient; 2977 IClientAPI client = World.GetScenePresence(m_host.TaskInventory[invItemID].PermsGranter).ControllingClient;
2978 SceneObjectPart targetPart = World.GetSceneObjectPart((UUID)target); 2978 SceneObjectPart targetPart = World.GetSceneObjectPart((UUID)target);
2979 if (targetPart.ParentGroup.RootPart.AttachmentPoint != 0)
2980 return; // Fail silently if attached
2979 SceneObjectGroup parentPrim = null, childPrim = null; 2981 SceneObjectGroup parentPrim = null, childPrim = null;
2980 if (targetPart != null) 2982 if (targetPart != null)
2981 { 2983 {
@@ -3015,6 +3017,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3015 if (linknum < ScriptBaseClass.LINK_THIS) 3017 if (linknum < ScriptBaseClass.LINK_THIS)
3016 return; 3018 return;
3017 SceneObjectGroup parentPrim = m_host.ParentGroup; 3019 SceneObjectGroup parentPrim = m_host.ParentGroup;
3020 if (parentPrim.RootPart.AttachmentPoint != 0)
3021 return; // Fail silently if attached
3018 SceneObjectPart childPrim = null; 3022 SceneObjectPart childPrim = null;
3019 switch (linknum) 3023 switch (linknum)
3020 { 3024 {
@@ -3072,6 +3076,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3072 { 3076 {
3073 m_host.AddScriptLPS(1); 3077 m_host.AddScriptLPS(1);
3074 SceneObjectGroup parentPrim = m_host.ParentGroup; 3078 SceneObjectGroup parentPrim = m_host.ParentGroup;
3079 if (parentPrim.RootPart.AttachmentPoint != 0)
3080 return; // Fail silently if attached
3075 List<SceneObjectPart> parts = new List<SceneObjectPart>(parentPrim.Children.Values); 3081 List<SceneObjectPart> parts = new List<SceneObjectPart>(parentPrim.Children.Values);
3076 parts.Remove(parentPrim.RootPart); 3082 parts.Remove(parentPrim.RootPart);
3077 foreach (SceneObjectPart part in parts) 3083 foreach (SceneObjectPart part in parts)
@@ -3435,6 +3441,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3435 3441
3436 public LSL_String llGetAnimation(string id) 3442 public LSL_String llGetAnimation(string id)
3437 { 3443 {
3444 // This should only return a value if the avatar is in the same region
3438 m_host.AddScriptLPS(1); 3445 m_host.AddScriptLPS(1);
3439 NotImplemented("llGetAnimation"); 3446 NotImplemented("llGetAnimation");
3440 return String.Empty; 3447 return String.Empty;
@@ -4649,6 +4656,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4649 return 0; 4656 return 0;
4650 } 4657 }
4651 4658
4659 if (agent.IsChildAgent)
4660 return 0; // Fail if they are not in the same region
4661
4652 // note: in OpenSim, sitting seems to cancel AGENT_ALWAYS_RUN, unlike SL 4662 // note: in OpenSim, sitting seems to cancel AGENT_ALWAYS_RUN, unlike SL
4653 if (agent.SetAlwaysRun) 4663 if (agent.SetAlwaysRun)
4654 { 4664 {
@@ -4728,6 +4738,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4728 4738
4729 public LSL_String llGetAgentLanguage(string id) 4739 public LSL_String llGetAgentLanguage(string id)
4730 { 4740 {
4741 // This should only return a value if the avatar is in the same region
4731 m_host.AddScriptLPS(1); 4742 m_host.AddScriptLPS(1);
4732 NotImplemented("llGetAgentLanguage"); 4743 NotImplemented("llGetAgentLanguage");
4733 return ""; 4744 return "";
@@ -4933,7 +4944,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4933 m_host.AddScriptLPS(1); 4944 m_host.AddScriptLPS(1);
4934 ScenePresence avatar = World.GetScenePresence((UUID)id); 4945 ScenePresence avatar = World.GetScenePresence((UUID)id);
4935 LSL_Vector agentSize; 4946 LSL_Vector agentSize;
4936 if (avatar == null) 4947 if (avatar == null || avatar.IsChildAgent) // Fail if not in the same region
4937 { 4948 {
4938 agentSize = ScriptBaseClass.ZERO_VECTOR; 4949 agentSize = ScriptBaseClass.ZERO_VECTOR;
4939 } 4950 }
@@ -4967,7 +4978,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4967 if (!UUID.TryParse(agent, out agentId)) 4978 if (!UUID.TryParse(agent, out agentId))
4968 return new LSL_Integer(0); 4979 return new LSL_Integer(0);
4969 ScenePresence presence = World.GetScenePresence(agentId); 4980 ScenePresence presence = World.GetScenePresence(agentId);
4970 if (presence == null) 4981 if (presence == null || presence.IsChildAgent) // Return flase for child agents
4971 return new LSL_Integer(0); 4982 return new LSL_Integer(0);
4972 IClientAPI client = presence.ControllingClient; 4983 IClientAPI client = presence.ControllingClient;
4973 if (m_host.GroupID == client.ActiveGroupId) 4984 if (m_host.GroupID == client.ActiveGroupId)
@@ -6374,7 +6385,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6374 6385
6375 LSL_List l = new LSL_List(); 6386 LSL_List l = new LSL_List();
6376 ScenePresence av = World.GetScenePresence((UUID)id); 6387 ScenePresence av = World.GetScenePresence((UUID)id);
6377 if (av == null) 6388 if (av == null || av.IsChildAgent) // only if in the region
6378 return l; 6389 return l;
6379 UUID[] anims; 6390 UUID[] anims;
6380 anims = av.GetAnimationArray(); 6391 anims = av.GetAnimationArray();