aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs26
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs13
2 files changed, 30 insertions, 9 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
index 3495305..3615e94 100644
--- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
+++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
@@ -932,14 +932,17 @@ namespace OpenSim.Region.ScriptEngine.Common
932 } 932 }
933 933
934 public LSL_Types.LSLInteger llDetectedGroup(int number) 934 public LSL_Types.LSLInteger llDetectedGroup(int number)
935 { //CFK: I *think* this is right, but am not sure. 935 {
936 m_host.AddScriptLPS(1); 936 m_host.AddScriptLPS(1);
937 EntityBase SensedObject = entityDetectedKey(number); 937 UUID SensedUUID = uuidDetectedKey(number);
938 if (SensedObject == null) 938 if (SensedUUID == UUID.Zero)
939 return new LSL_Types.LSLInteger(0); 939 return new LSL_Types.LSLInteger(0);
940 if (m_host.GroupID == m_host.ParentGroup.RootPart.GroupID) 940 ScenePresence presence = World.GetScenePresence(SensedUUID);
941 IClientAPI client = presence.ControllingClient;
942 if (m_host.GroupID == client.ActiveGroupId)
941 return new LSL_Types.LSLInteger(1); 943 return new LSL_Types.LSLInteger(1);
942 return new LSL_Types.LSLInteger(0); 944 else
945 return new LSL_Types.LSLInteger(0);
943 } 946 }
944 947
945 public LSL_Types.LSLInteger llDetectedLinkNumber(int number) 948 public LSL_Types.LSLInteger llDetectedLinkNumber(int number)
@@ -4708,8 +4711,17 @@ namespace OpenSim.Region.ScriptEngine.Common
4708 public LSL_Types.LSLInteger llSameGroup(string agent) 4711 public LSL_Types.LSLInteger llSameGroup(string agent)
4709 { 4712 {
4710 m_host.AddScriptLPS(1); 4713 m_host.AddScriptLPS(1);
4711 NotImplemented("llSameGroup"); 4714 UUID agentId = new UUID();
4712 return 0; 4715 if (!UUID.TryParse(agent, out agentId))
4716 return new LSL_Types.LSLInteger(0);
4717 ScenePresence presence = World.GetScenePresence(agentId);
4718 if (presence == null)
4719 return new LSL_Types.LSLInteger(0);
4720 IClientAPI client = presence.ControllingClient;
4721 if (m_host.GroupID == client.ActiveGroupId)
4722 return new LSL_Types.LSLInteger(1);
4723 else
4724 return new LSL_Types.LSLInteger(0);
4713 } 4725 }
4714 4726
4715 public void llUnSit(string id) 4727 public void llUnSit(string id)
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 4219854..20b52b7 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -4553,8 +4553,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4553 public LSL_Types.LSLInteger llSameGroup(string agent) 4553 public LSL_Types.LSLInteger llSameGroup(string agent)
4554 { 4554 {
4555 m_host.AddScriptLPS(1); 4555 m_host.AddScriptLPS(1);
4556 NotImplemented("llSameGroup"); 4556 UUID agentId = new UUID();
4557 return 0; 4557 if (!UUID.TryParse(agent, out agentId))
4558 return new LSL_Types.LSLInteger(0);
4559 ScenePresence presence = World.GetScenePresence(agentId);
4560 if (presence == null)
4561 return new LSL_Types.LSLInteger(0);
4562 IClientAPI client = presence.ControllingClient;
4563 if (m_host.GroupID == client.ActiveGroupId)
4564 return new LSL_Types.LSLInteger(1);
4565 else
4566 return new LSL_Types.LSLInteger(0);
4558 } 4567 }
4559 4568
4560 public void llUnSit(string id) 4569 public void llUnSit(string id)